[buddypress-trac] [BuddyPress Trac] #6252: bp_core_referrer() not returning leading slash

buddypress-trac noreply at wordpress.org
Wed Feb 25 01:55:42 UTC 2015

#6252: bp_core_referrer() not returning leading slash
 Reporter:  mechter                  |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  2.3
Component:  API                      |     Version:  2.2.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 2.3


 Thanks for the report, mechter. Good catch. I agree that this is a bug,
 and to be honest it renders the `bp_core_referrer()` function next to
 useless. That being said, the function has been around since the very
 earliest days of BuddyPress, so it's likely that someone out there is
 using it for some purpose, and expects *not* to have the leading slash. In
 the interest of not breaking their sites, I'm going to suggest that we add
 the leading slash right in `bp_core_set_uri_globals()`:

 if ( defined( 'DOING_AJAX' ) && DOING_AJAX || strpos(
 $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
         $path = '/' . bp_core_referrer();
         $path = esc_url( $_SERVER['REQUEST_URI'] );

 What do you think?

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6252#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list