Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/25/2015 02:56:18 PM (11 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-loader.php

    r9557 r9559  
    462462            require( $this->plugin_dir . 'bp-core/deprecated/2.1.php' );
    463463            require( $this->plugin_dir . 'bp-core/deprecated/2.2.php' );
     464            require( $this->plugin_dir . 'bp-core/deprecated/2.3.php' );
    464465        }
    465466    }
Note: See TracChangeset for help on using the changeset viewer.