Ticket #18007: 18007.4.patch
File 18007.4.patch, 1.4 KB (added by , 13 years ago) |
---|
-
wp-includes/functions.php
245 245 * @return bool False if not serialized and true if it was. 246 246 */ 247 247 function is_serialized( $data ) { 248 static $is_overloaded; 249 250 if ( ! isset( $is_overloaded ) ) 251 $is_overloaded = ( ( ini_get( 'mbstring.func_overload' ) & 2 ) != 0 ) && function_exists( 'mb_strlen' ); 252 248 253 // if it isn't a string, it isn't serialized 249 254 if ( ! is_string( $data ) ) 250 255 return false; 251 256 $data = trim( $data ); 252 257 if ( 'N;' == $data ) 253 258 return true; 254 $length = strlen( $data );259 $length = ( $is_overloaded ) ? mb_strlen( $data, 'pass' ) : strlen( $data ); 255 260 if ( $length < 4 ) 256 261 return false; 257 262 if ( ':' !== $data[1] ) … … 284 289 * @return bool False if not a serialized string, true if it is. 285 290 */ 286 291 function is_serialized_string( $data ) { 292 static $is_overloaded; 293 294 if ( ! isset( $is_overloaded ) ) 295 $is_overloaded = ( ( ini_get( 'mbstring.func_overload' ) & 2 ) != 0 ) && function_exists( 'mb_strlen' ); 296 287 297 // if it isn't a string, it isn't a serialized string 288 298 if ( !is_string( $data ) ) 289 299 return false; 290 300 $data = trim( $data ); 291 $length = strlen( $data );301 $length = ( $is_overloaded ) ? mb_strlen( $data, 'pass' ) : strlen( $data ); 292 302 if ( $length < 4 ) 293 303 return false; 294 304 elseif ( ':' !== $data[1] )