Ticket #28162: 28162.4.patch
File 28162.4.patch, 3.4 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/image.php
289 289 if ( ! empty( $iptc['2#120'][0] ) ) { // description / legacy caption 290 290 $caption = trim( $iptc['2#120'][0] ); 291 291 if ( empty( $meta['title'] ) ) { 292 mbstring_binary_safe_encoding(); 292 293 // Assume the title is stored in 2:120 if it's short. 293 294 if ( strlen( $caption ) < 80 ) 294 295 $meta['title'] = $caption; 295 296 else 296 297 $meta['caption'] = $caption; 298 reset_mbstring_encoding(); 297 299 } elseif ( $caption != $meta['title'] ) { 298 300 $meta['caption'] = $caption; 299 301 } … … 326 328 $meta['title'] = trim( $exif['Title'] ); 327 329 328 330 if ( ! empty( $exif['ImageDescription'] ) ) { 331 mbstring_binary_safe_encoding(); 329 332 if ( empty( $meta['title'] ) && strlen( $exif['ImageDescription'] ) < 80 ) { 330 333 // Assume the title is stored in ImageDescription 331 334 $meta['title'] = trim( $exif['ImageDescription'] ); … … 334 337 } elseif ( trim( $exif['ImageDescription'] ) != $meta['title'] ) { 335 338 $meta['caption'] = trim( $exif['ImageDescription'] ); 336 339 } 340 reset_mbstring_encoding(); 337 341 } elseif ( ! empty( $exif['Comments'] ) && trim( $exif['Comments'] ) != $meta['title'] ) { 338 342 $meta['caption'] = trim( $exif['Comments'] ); 339 343 } -
src/wp-includes/formatting.php
410 410 * @return bool True if $str fits a UTF-8 model, false otherwise. 411 411 */ 412 412 function seems_utf8($str) { 413 mbstring_binary_safe_encoding(); 413 414 $length = strlen($str); 415 reset_mbstring_encoding(); 414 416 for ($i=0; $i < $length; $i++) { 415 417 $c = ord($str[$i]); 416 418 if ($c < 0x80) $n = 0; # 0bbbbbbb … … 634 636 $num_octets = 1; 635 637 $unicode_length = 0; 636 638 639 mbstring_binary_safe_encoding(); 637 640 $string_length = strlen( $utf8_string ); 641 reset_mbstring_encoding(); 642 638 643 for ($i = 0; $i < $string_length; $i++ ) { 639 644 640 645 $value = ord( $utf8_string[ $i ] ); -
src/wp-includes/pomo/mo.php
75 75 $current_addr++; 76 76 $originals_table = chr(0); 77 77 78 $reader = new POMO_Reader(); 79 78 80 foreach($entries as $entry) { 79 81 $originals_table .= $this->export_original($entry) . chr(0); 80 $length = strlen($this->export_original($entry));82 $length = $reader->strlen($this->export_original($entry)); 81 83 fwrite($fh, pack('VV', $length, $current_addr)); 82 84 $current_addr += $length + 1; // account for the NULL byte after 83 85 } 84 86 85 87 $exported_headers = $this->export_headers(); 86 fwrite($fh, pack('VV', strlen($exported_headers), $current_addr));88 fwrite($fh, pack('VV', $reader->strlen($exported_headers), $current_addr)); 87 89 $current_addr += strlen($exported_headers) + 1; 88 90 $translations_table = $exported_headers . chr(0); 89 91 90 92 foreach($entries as $entry) { 91 93 $translations_table .= $this->export_translations($entry) . chr(0); 92 $length = strlen($this->export_translations($entry));94 $length = $reader->strlen($this->export_translations($entry)); 93 95 fwrite($fh, pack('VV', $length, $current_addr)); 94 96 $current_addr += $length + 1; 95 97 }