Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20909] trunk/wp-admin/credits.php: Skip cached credits if version number doesn\'t match. Date:Fri, 25 May 2012 18:52:14 +0000 (UTC)
 

Revision
20909
Author
nacin
Date
2012-05-25 18:52:13 +0000 (Fri, 25 May 2012)

Log Message

Skip cached credits if version number doesn't match. props duck_. fixes #20270.

Modified Paths

Diff

Modified: trunk/wp-admin/credits.php (20908 => 20909)


--- trunk/wp-admin/credits.php	2012-05-25 18:41:22 UTC (rev 20908)
+++ trunk/wp-admin/credits.php	2012-05-25 18:52:13 UTC (rev 20909)
@@ -17,7 +17,9 @@
 
 	$results = get_site_transient( 'wordpress_credits_' . $locale );
 
-	if ( ! is_array( $results ) ) {
+	if ( ! is_array( $results )
+		|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
+	) {
 		$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
 
 		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )