Changeset 28808
- Timestamp:
- 06/23/2014 10:20:23 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r28806 r28808 290 290 $caption = trim( $iptc['2#120'][0] ); 291 291 if ( empty( $meta['title'] ) ) { 292 mbstring_binary_safe_encoding(); 293 $caption_length = strlen( $caption ); 294 reset_mbstring_encoding(); 295 292 296 // Assume the title is stored in 2:120 if it's short. 293 if ( mbstring_binary_safe_strlen( $caption ) < 80 )297 if ( $caption_length < 80 ) { 294 298 $meta['title'] = $caption; 295 else299 } else { 296 300 $meta['caption'] = $caption; 301 } 297 302 } elseif ( $caption != $meta['title'] ) { 298 303 $meta['caption'] = $caption; … … 328 333 329 334 if ( ! empty( $exif['ImageDescription'] ) ) { 330 if ( empty( $meta['title'] ) && mbstring_binary_safe_strlen( $exif['ImageDescription'] ) < 80 ) { 335 mbstring_binary_safe_encoding(); 336 $description_length = strlen( $exif['ImageDescription'] ); 337 reset_mbstring_encoding(); 338 339 if ( empty( $meta['title'] ) && $description_length < 80 ) { 331 340 // Assume the title is stored in ImageDescription 332 341 $meta['title'] = trim( $exif['ImageDescription'] ); -
trunk/src/wp-includes/formatting.php
r28806 r28808 482 482 */ 483 483 function seems_utf8($str) { 484 $length = mbstring_binary_safe_strlen($str); 484 mbstring_binary_safe_encoding(); 485 $length = strlen($str); 486 reset_mbstring_encoding(); 485 487 for ($i=0; $i < $length; $i++) { 486 488 $c = ord($str[$i]); … … 706 708 $unicode_length = 0; 707 709 708 $string_length = mbstring_binary_safe_strlen( $utf8_string ); 710 mbstring_binary_safe_encoding(); 711 $string_length = strlen( $utf8_string ); 712 reset_mbstring_encoding(); 713 709 714 for ($i = 0; $i < $string_length; $i++ ) { 710 715 -
trunk/src/wp-includes/functions.php
r28806 r28808 4406 4406 4407 4407 /** 4408 * Uses a binary-safe encoding to get the length of a string in bytes if func_overload is enabled.4409 *4410 * @see mbstring_binary_safe_encoding()4411 *4412 * @since 4.0.04413 *4414 * @param string $string The string to get the length of.4415 * @return int The length of the string in bytes.4416 */4417 function mbstring_binary_safe_strlen( $string ) {4418 mbstring_binary_safe_encoding();4419 $length = strlen( $string );4420 reset_mbstring_encoding();4421 4422 return $length;4423 }4424 4425 /**4426 4408 * Alternative to filter_var( $var, FILTER_VALIDATE_BOOLEAN ) 4427 4409 *
Note: See TracChangeset
for help on using the changeset viewer.