Changeset 9559 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 02/25/2015 02:56:18 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.