Opened 6 weeks ago
Closed 4 weeks ago
#9307 closed defect (bug) (fixed)
closedir() should be called conditionally
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 15.0.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Core | Keywords: | commit |
| Cc: | emaralive, GaryJ |
Description
BuddyPress 14.3.4 has a PHP 8 compatibility bug where closedir() is called outside the conditional block that checks if opendir() succeeded. This causes fatal errors on platforms that intentionally return empty strings for avatar directories (e.g. WPVIP's file service).
In two places in BuddyPress, closedir() is called unconditionally:
- Line 571 in
bp_core_fetch_avatar() - Line 865 in
bp_core_delete_existing_avatar()
This generates a noisy set of PHP warnings that can't be worked around with filters, and only a patch being applied to BuddyPress works. If the closedir() called was inside the conditional that uses opendir(), then the same intended behaviour would still work, but without the warning from PHP 8.
Change History (5)
#3
@
6 weeks ago
- Milestone changed from Awaiting Review to Under Consideration
- Owner set to espellcaste
- Status changed from new to assigned
I can handle this. Thanks for the bug report and the prior art.
See this change for BuddyBoss which tackles the same issue.