Changeset 9559
- Timestamp:
- 02/25/2015 02:56:18 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-catchuri.php
r9517 r9559 52 52 // Ajax or not? 53 53 if ( defined( 'DOING_AJAX' ) && DOING_AJAX || strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) ) 54 $path = bp_ core_referrer();54 $path = bp_get_referer_path(); 55 55 else 56 56 $path = esc_url( $_SERVER['REQUEST_URI'] ); -
trunk/src/bp-core/bp-core-functions.php
r9507 r9559 836 836 837 837 /** 838 * Return the referrer URL without the http(s):// 839 * 840 * @return string The referrer URL. 841 */ 842 function bp_core_referrer() { 843 $referer = explode( '/', wp_get_referer() ); 844 unset( $referer[0], $referer[1], $referer[2] ); 845 return implode( '/', $referer ); 838 * Return the URL path of the referring page. 839 * 840 * This is a wrapper for `wp_get_referer()` that sanitizes the referer URL to 841 * a webroot-relative path. For example, 'http://example.com/foo/' will be 842 * reduced to '/foo/'. 843 * 844 * @since BuddyPress (2.3.0) 845 * 846 * @return bool|string Returns false on error, a URL path on success. 847 */ 848 function bp_get_referer_path() { 849 $referer = wp_get_referer(); 850 851 if ( false === $referer ) { 852 return false; 853 } 854 855 // Turn into an absolute path. 856 $referer = preg_replace( '|https?\://[^/]+/|', '/', $referer ); 857 858 return $referer; 846 859 } 847 860 -
trunk/src/bp-loader.php
r9557 r9559 462 462 require( $this->plugin_dir . 'bp-core/deprecated/2.1.php' ); 463 463 require( $this->plugin_dir . 'bp-core/deprecated/2.2.php' ); 464 require( $this->plugin_dir . 'bp-core/deprecated/2.3.php' ); 464 465 } 465 466 }
Note: See TracChangeset
for help on using the changeset viewer.