Use maybe_serialize() where appropriate. fixes #19617.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-04-27 15:57:51 +00:00
parent 3f51df65e0
commit c68f8c46f0
3 changed files with 11 additions and 11 deletions

View File

@ -1212,9 +1212,9 @@ function wp_check_browser_version() {
* 'img_src' - string - An image representing the browser
* 'img_src_ssl' - string - An image (over SSL) representing the browser
*/
$response = unserialize( wp_remote_retrieve_body( $response ) );
$response = maybe_unserialize( wp_remote_retrieve_body( $response ) );
if ( ! $response )
if ( ! is_array( $response ) )
return false;
set_site_transient( 'browser_' . $key, $response, 604800 ); // cache for 1 week

View File

@ -843,7 +843,7 @@ function wpmu_activate_signup($key) {
return new WP_Error( 'already_active', __( 'The site is already active.' ), $signup );
}
$meta = unserialize($signup->meta);
$meta = maybe_unserialize($signup->meta);
$user_login = $wpdb->escape($signup->user_login);
$user_email = $wpdb->escape($signup->user_email);
$password = wp_generate_password( 12, false );

View File

@ -885,14 +885,14 @@ function count_users($strategy = 'time') {
$users_of_blog = $wpdb->get_col( "SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = '{$blog_prefix}capabilities'" );
foreach ( $users_of_blog as $caps_meta ) {
$b_roles = unserialize($caps_meta);
if ( is_array($b_roles) ) {
foreach ( $b_roles as $b_role => $val ) {
if ( isset($avail_roles[$b_role]) ) {
$avail_roles[$b_role]++;
} else {
$avail_roles[$b_role] = 1;
}
$b_roles = maybe_unserialize($caps_meta);
if ( ! is_array( $b_roles ) )
continue;
foreach ( $b_roles as $b_role => $val ) {
if ( isset($avail_roles[$b_role]) ) {
$avail_roles[$b_role]++;
} else {
$avail_roles[$b_role] = 1;
}
}
}