Make WordPress Core


Ignore:
Timestamp:
05/17/2011 04:36:37 PM (14 years ago)
Author:
markjaquith
Message:

Make sure we have an array on the Credits page. Handles situations where non-array data is sometimes cached.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/credits.php

    r17942 r17945  
    3030    $results = get_site_transient( 'wordpress_credits' );
    3131
    32     if ( false === $results ) {
     32    if ( !is_array( $results ) ) {
    3333        $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
    3434
     
    3838        $results = unserialize( wp_remote_retrieve_body( $response ) );
    3939
    40         if ( ! $results )
     40        if ( !is_array( $results ) )
    4141            return false;
    4242
     
    6161$results = wp_credits();
    6262
    63 if ( ! $results ) {
     63if ( !isset( $results['people'] ) ) {
    6464    echo '<p>' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
    6565        'http://wordpress.org/about/',
     
    7373$gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
    7474
    75 foreach ( $results['people'] as $group_slug => $members ) {
     75foreach ( (array) $results['people'] as $group_slug => $members ) {
    7676    echo '<h3 class="wp-people-group">' . translate( $results['groups'][ $group_slug ] ) . "</h3>\n";
    7777    echo '<ul class="wp-people-group" id="wp-people-group-' . $group_slug . '">' . "\n";
Note: See TracChangeset for help on using the changeset viewer.