Opened 11 months ago
Closed 9 months ago
#9307 closed defect (bug) (fixed)
closedir() should be called conditionally
| Reported by: | GaryJ | Owned by: | johnjamesjacoby |
|---|---|---|---|
| Priority: | normal | Milestone: | 14.5.0 |
| Component: | Media | Version: | |
| Severity: | normal | 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 (9)
#3
@
11 months ago
- Milestone Awaiting Review → Under Consideration
- Owner set to
- Status new → assigned
I can handle this. Thanks for the bug report and the prior art.
#4
@
11 months ago
- Keywords commit added
- Milestone Under Consideration → 15.0.0
- Owner changed from to
#6
@
9 months ago
I see some recent changes from other tickets I've opened have been milestoned for 14.5.0. Any chance this one could move from 15.0.0 to 14.5.0 as well please?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
See this change for BuddyBoss which tackles the same issue.