Skip to:
Content

BuddyPress.org

Opened 15 months ago

Closed 5 weeks ago

#8920 closed enhancement (fixed)

customizer_set_uri can cause depreciation notice in PHP 8.1

Reported by: thomaslhotta's profile thomaslhotta Owned by: espellcaste's profile espellcaste
Milestone: 14.1.0 Priority: low
Severity: minor Version: 11.2.0
Component: Templates 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 @espellcaste
3 months ago

  • Milestone changed from Awaiting Review to Up Next
  • Owner set to espellcaste
  • Severity changed from normal to minor
  • Status changed from new to assigned

#2 @imath
2 months ago

  • Milestone changed from Up Next to 15.0.0

This ticket was mentioned in PR #339 on buddypress/buddypress by renatonascalves.


2 months ago
#3

  • Keywords has-patch added

#4 @espellcaste
2 months ago

  • Priority changed from normal to low
  • Type changed from defect (bug) to 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.

#5 @espellcaste
7 weeks ago

@imath What do you think?

#6 @imath
7 weeks 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 @espellcaste
7 weeks 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.

#8 @espellcaste
6 weeks ago

@imath Pinging you to confirm if you agree with the suggestion above.

#9 @imath
5 weeks 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.

#10 @espellcaste
5 weeks ago

  • Milestone changed from 15.0.0 to 14.1.0

@imath Awesome. But I assume we don't want to patch BP 11, right? Only in 14.1, correct?

#11 @imath
5 weeks ago

@espellcaste absolutely correct, we only patch back in case of security issues.

#12 @espellcaste
5 weeks ago

In 14003:

Fire the customizer_set_uri method for regular themes when BP Classic is activated.

Restore the deprecated (in BP 12.0) customizer_set_uri method since we still need to support it for regular themes using BP Classic.

We are also fixing a PHP 8.1 deprecated notice.

Props thomaslhotta, imath.

See #8920 (trunk)
Closes https://github.com/buddypress/buddypress/pull/339

#13 @espellcaste
5 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 14004:

Fire the customizer_set_uri method for regular themes when BP Classic is activated.

Restore the deprecated (in BP 12.0) customizer_set_uri method since we still need to support it for regular themes using BP Classic.

We are also fixing a PHP 8.1 deprecated notice.

Props thomaslhotta, imath.

Fixes #8920 (branch 14.0)

Note: See TracTickets for help on using tickets.