Message info
 
To:buddypress-trac@lists.automattic.com From:buddypress-trac@lists.automattic.com Subject:[buddypress-trac] [BuddyPress][6103] trunk/bp-core/bp-core-catchuri.php: Update bp_core_set_uri_globals() to check for DOING_AJAX when inspecting the request URI. Date:Fri, 15 Jun 2012 19:13:58 +0000 (UTC)
 

Revision
6103
Author
djpaul
Date
2012-06-15 19:13:58 +0000 (Fri, 15 Jun 2012)

Log Message

Update bp_core_set_uri_globals() to check for DOING_AJAX when inspecting the request URI.
This is required because of 1.6's change to the javascript ajaxurl variable. The check for wp-load.php remains for backwards compatibility.

Fixes #4263, props boonebgorges

Modified Paths

Diff

Modified: trunk/bp-core/bp-core-catchuri.php (6102 => 6103)


--- trunk/bp-core/bp-core-catchuri.php	2012-06-15 19:06:38 UTC (rev 6102)
+++ trunk/bp-core/bp-core-catchuri.php	2012-06-15 19:13:58 UTC (rev 6103)
@@ -52,7 +52,7 @@
 		$bp->pages = bp_core_get_directory_pages();
 
 	// Ajax or not?
-	if ( strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
+	if ( defined( 'DOING_AJAX' ) && DOING_AJAX || strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
 		$path = bp_core_referrer();
 	else
 		$path = esc_url( $_SERVER['REQUEST_URI'] );