Skip to:

Opened 7 months ago

Closed 7 months ago

#9060 closed defect (bug) (fixed)

bp_rewrites_get_url filter is not supplied original function arguments

Reported by: sjregan's profile sjregan Owned by: imath's profile imath
Milestone: 14.0.0 Priority: normal
Severity: normal Version: 12.0.0
Component: Core Keywords: has-patch


For the bp_rewrites_get_url() function, an optional list of arguments can be provided to the function for determining what URL will be built.

At the end of the function, the resulting URL is filtering using the bp_rewrites_get_url filter. The filter is supplied with a modified version of the function arguments rather than the original function arguments.

This means when filtering the URL critical fields such as 'component_id' are not passed to the filter.

Seen in v12 through v14-alpha.

Change History (4)

This ticket was mentioned in PR #213 on buddypress/buddypress by sjregan.

7 months ago

  • Keywords has-patch added

…r (fixes #9060)

The bp_rewrites_get_url() function passes function arguments after they have been modified by the function. This fix ensures the original function arguments are passed to the filter so critical fields remain intact.

Trac ticket:

@imath commented on PR #213:

7 months ago

Hi @sjregan Thanks for your contribution. Patch is looking good after a quick look. I'll check it more deeply.

#3 @imath
7 months ago

  • Milestone changed from Awaiting Review to 14.0.0

#4 @imath
7 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 13691:

Improve the 'bp_rewrites_get_url' filter additional parameters

  • Make sure the first additional parameter $path_chunks contains an unchanged & parsed version of the function original arguments.
  • Add a second additional parameter $args containing the function original arguments.

Props sjregan

Fixes #9060

Note: See TracTickets for help on using tickets.