[buddypress-trac] [BuddyPress Trac] #6252: bp_core_referrer() not returning leading slash
buddypress-trac
noreply at wordpress.org
Wed Feb 25 14:56:19 UTC 2015
#6252: bp_core_referrer() not returning leading slash
-------------------------------------+---------------------------
Reporter: mechter | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 2.3
Component: API | Version: 2.2.1
Severity: normal | Resolution: fixed
Keywords: has-patch needs-testing |
-------------------------------------+---------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"9559"]:
{{{
#!CommitTicketReference repository="" revision="9559"
Improve AJAX referer determination during URI parsing.
When parsing referer URLs during `bp_core_set_uri_globals()`, BP has
historically used `bp_core_referrer()` to generate a "current URL"
relative to
the current web root. This path is then passed to the 'bp_uri' filter
before
being parsed. However, `bp_core_referrer()` incorrectly returns a URL
without
a leading slash, making it a relative path rather than a webroot-absolute
path.
The parsing logic later in `bp_core_set_uri_globals()` makes it so that
the
error does not matter from the point of BP core, but plugins filtering
'bp_uri'
will receive a potentially incorrect URL path.
This changeset deprecates the unreliable `bp_core_referrer()` in favor of
`bp_get_referer_path()`. The latter function correctly returns URL paths
with a
leading slash. `bp_get_referer_path()` is then used instead of
`bp_core_referrer()` in `bp_core_set_uri_globals()`.
Props mechter for an initial patch.
Fixes #6252.
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6252#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list