Make WordPress Core

Changeset 14321


Ignore:
Timestamp:
04/30/2010 05:57:30 PM (15 years ago)
Author:
ryan
Message:

Replace dashes with empty strings instead of underscores so that keys match keys that might be stored in a persistent cache from 2.9. Remove current user reset. Kinda buggy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r14315 r14321  
    245245
    246246    // Keys used as object vars cannot have dashes.
    247     $key = str_replace('-', '_', $option);
     247    $key = str_replace('-', '', $option);
    248248
    249249    if ( isset( $user->{$wpdb->prefix . $key} ) ) // Blog specific
     
    703703        $value = maybe_unserialize($meta->meta_value);
    704704        // Keys used as object vars cannot have dashes.
    705         $key = str_replace('-', '_', $meta->meta_key);
     705        $key = str_replace('-', '', $meta->meta_key);
    706706        $user->{$key} = $value;
    707707    }
     
    882882 */
    883883function clean_user_cache($id) {
    884     global $current_user;
    885 
    886884    $user = new WP_User($id);
    887 
    888     // If the current user changed, reset the current_user global.Œ
    889     if ( isset($current_user) && $current_user->ID == $id ) {
    890         $current_user->ID = -1; // Force wp_set_current_user to reset.
    891         wp_set_current_user($id);
    892     }
    893885
    894886    wp_cache_delete($id, 'users');
Note: See TracChangeset for help on using the changeset viewer.