Make WordPress Core

Changeset 20612


Ignore:
Timestamp:
04/27/2012 03:57:51 PM (12 years ago)
Author:
nacin
Message:

Use maybe_serialize() where appropriate. fixes #19617.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r20609 r20612  
    12131213         *  'img_src_ssl' - string - An image (over SSL) representing the browser
    12141214         */
    1215         $response = unserialize( wp_remote_retrieve_body( $response ) );
    1216 
    1217         if ( ! $response )
     1215        $response = maybe_unserialize( wp_remote_retrieve_body( $response ) );
     1216
     1217        if ( ! is_array( $response ) )
    12181218            return false;
    12191219
  • trunk/wp-includes/ms-functions.php

    r20441 r20612  
    844844    }
    845845
    846     $meta = unserialize($signup->meta);
     846    $meta = maybe_unserialize($signup->meta);
    847847    $user_login = $wpdb->escape($signup->user_login);
    848848    $user_email = $wpdb->escape($signup->user_email);
  • trunk/wp-includes/user.php

    r20581 r20612  
    886886
    887887        foreach ( $users_of_blog as $caps_meta ) {
    888             $b_roles = unserialize($caps_meta);
    889             if ( is_array($b_roles) ) {
    890                 foreach ( $b_roles as $b_role => $val ) {
    891                     if ( isset($avail_roles[$b_role]) ) {
    892                         $avail_roles[$b_role]++;
    893                     } else {
    894                         $avail_roles[$b_role] = 1;
    895                     }
     888            $b_roles = maybe_unserialize($caps_meta);
     889            if ( ! is_array( $b_roles ) )
     890                continue;
     891            foreach ( $b_roles as $b_role => $val ) {
     892                if ( isset($avail_roles[$b_role]) ) {
     893                    $avail_roles[$b_role]++;
     894                } else {
     895                    $avail_roles[$b_role] = 1;
    896896                }
    897897            }
Note: See TracChangeset for help on using the changeset viewer.