Make WordPress Core


Ignore:
Timestamp:
06/23/2014 10:20:23 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Remove mbstring_binary_safe_strlen(). Use mbstring_binary_safe_encoding() and reset_mbstring_encoding() directly.

fixes #28162.

File:
1 edited

Legend:

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

    r28806 r28808  
    290290                $caption = trim( $iptc['2#120'][0] );
    291291                if ( empty( $meta['title'] ) ) {
     292                    mbstring_binary_safe_encoding();
     293                    $caption_length = strlen( $caption );
     294                    reset_mbstring_encoding();
     295
    292296                    // 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 ) {
    294298                        $meta['title'] = $caption;
    295                     else
     299                    } else {
    296300                        $meta['caption'] = $caption;
     301                    }
    297302                } elseif ( $caption != $meta['title'] ) {
    298303                    $meta['caption'] = $caption;
     
    328333
    329334        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 ) {
    331340                // Assume the title is stored in ImageDescription
    332341                $meta['title'] = trim( $exif['ImageDescription'] );
Note: See TracChangeset for help on using the changeset viewer.