Skip to:
Content

BuddyPress.org

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 @espellcaste
2 years ago

  • Milestone Awaiting ReviewUp Next
  • Owner set to espellcaste
  • Severity normalminor
  • Status newassigned

#2 @imath
2 years ago

  • Milestone Up Next15.0.0

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


2 years ago
#3

  • Keywords has-patch added

#4 @espellcaste
2 years ago

  • Priority normallow
  • 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.

#5 @espellcaste
2 years ago

@imath What do you think?

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

#8 @espellcaste
2 years ago

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

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

#10 @espellcaste
2 years ago

  • Milestone 15.0.014.1.0

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

#11 @imath
2 years ago

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

#12 @espellcaste
2 years 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
2 years ago

  • Resolutionfixed
  • Status assignedclosed

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.