Message info
 
To:buddypress-trac@lists.automattic.com From:buddypress-trac@lists.automattic.com Subject:[buddypress-trac] [BuddyPress][6062] trunk/bp-core/bp-core-avatars.php: Make sure that BP_AVATAR_UPLOAD_PATH and BP_AVATAR_URL are set. Date:Fri, 8 Jun 2012 20:19:20 +0000 (UTC)
 

Revision
6062
Author
djpaul
Date
2012-06-08 20:19:20 +0000 (Fri, 08 Jun 2012)

Log Message

Make sure that BP_AVATAR_UPLOAD_PATH and BP_AVATAR_URL are set. Fixes #4243.

This improves backwards compatibility with BP 1.2 era code which used these
constants directly, instead of the $bp->avatar->upload_path and
$bp->avatar->url variables (which didn't exist then).

Modified Paths

Diff

Modified: trunk/bp-core/bp-core-avatars.php (6061 => 6062)


--- trunk/bp-core/bp-core-avatars.php	2012-06-06 20:40:20 UTC (rev 6061)
+++ trunk/bp-core/bp-core-avatars.php	2012-06-08 20:19:20 UTC (rev 6062)
@@ -71,6 +71,14 @@
 	$bp->avatar->upload_path = bp_core_avatar_upload_path();
 	$bp->avatar->url	   	 = bp_core_avatar_url();
 
+	// Backpat for pre-1.5
+	if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) )
+		define( 'BP_AVATAR_UPLOAD_PATH', $bp->avatar->upload_path );
+
+	// Backpat for pre-1.5
+	if ( ! defined( 'BP_AVATAR_URL' ) )
+		define( 'BP_AVATAR_URL', $bp->avatar->url );
+
 	do_action( 'bp_core_set_avatar_globals' );
 }
 add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );