Opened 3 years ago
Closed 2 years ago
#8920 closed enhancement (fixed)
customizer_set_uri can cause depreciation notice in PHP 8.1
| Reported by: | thomaslhotta | Owned by: | espellcaste |
|---|---|---|---|
| Priority: | low | Milestone: | 14.1.0 |
| Component: | Templates | Version: | 11.2.0 |
| Severity: | minor | Keywords: | has-patch |
| Cc: |
Description
Hi
In the function customizer_set_uri on line 693 the 'query' key of $uri can be empty. If that is the case, a depreciation notice will be emitted.
I think the best solution would be to change the preceding else statement to an
else if ( ! empty( $uri['query'] ) {
because if the query key is empty the rest of the functionality does nothing anyway.
Change History (13)
#1
@
2 years ago
- Milestone Awaiting Review → Up Next
- Owner set to
- Severity normal → minor
- Status new → assigned
This ticket was mentioned in PR #339 on buddypress/buddypress by renatonascalves.
2 years ago
#3
- Keywords has-patch added
#4
@
2 years ago
- Priority normal → low
- Type defect (bug) → enhancement
This is a tricky one. The related method was deprecated since BuddyPress 12.0. But it is available in BuddyPress 11.2.0, which is where the issue is occurring.
We have a fix available here. But this fix is useless since mentioned, the code is deprecated in the latest version of BuddyPress.
I'd argue that we should not backport this to BP 11.2.0 since this is not a security issue, and advocate @thomaslhotta to upgrade BuddyPress instead.
But if we decide to backport this to 11, we have the patch here.
#6
@
2 years ago
I agree with you @espellcaste, let's avoid the deprecated notice in 15.0 and up if people are still using this method although it's deprecated.
#7
@
2 years ago
@imath This is an internal method used by the BP_Nouveau class, so the issue is not that external people are using it.
The issue happens in a previous version of BuddyPress (11.2.0), but since it was deprecated, the reported error is gone since the method is not used anymore internally.
I'd suggest removing the method in 15.0 rather than patch it.
#9
@
2 years ago
I disagree! My bad, here's the explanation: https://github.com/buddypress/buddypress/pull/339/commits/0a65d4a790af65b6b693bb0ad1faaa69140f9af0
It's probably best to fix this earlier than 15.0.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8920