From 4eaf5b3ed9bcfe019812232192ee13f19472de88 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Tue, 17 May 2011 16:36:37 +0000 Subject: [PATCH] Make sure we have an array on the Credits page. Handles situations where non-array data is sometimes cached. git-svn-id: http://svn.automattic.com/wordpress/trunk@17945 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/credits.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/credits.php b/wp-admin/credits.php index 28122a0e0..17f52d6e2 100644 --- a/wp-admin/credits.php +++ b/wp-admin/credits.php @@ -29,7 +29,7 @@ function wp_credits() { $results = get_site_transient( 'wordpress_credits' ); - if ( false === $results ) { + if ( !is_array( $results ) ) { $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 ) ) @@ -37,7 +37,7 @@ function wp_credits() { $results = unserialize( wp_remote_retrieve_body( $response ) ); - if ( ! $results ) + if ( !is_array( $results ) ) return false; set_site_transient( 'wordpress_credits', $results, 604800 ); // One week. @@ -60,7 +60,7 @@ include( './admin-header.php' ); $results = wp_credits(); -if ( ! $results ) { +if ( !isset( $results['people'] ) ) { echo '

' . sprintf( __( 'WordPress is created by a worldwide team of passionate individuals. Get involved in WordPress.' ), 'http://wordpress.org/about/', 'http://codex.wordpress.org/Contributing_to_WordPress' ) . '

'; @@ -72,7 +72,7 @@ echo '

' . __( "WordPress is created by a worldwide team of passionate individ $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/'; -foreach ( $results['people'] as $group_slug => $members ) { +foreach ( (array) $results['people'] as $group_slug => $members ) { echo '

' . translate( $results['groups'][ $group_slug ] ) . "

\n"; echo '