Make WordPress Core


Ignore:
Timestamp:
09/11/2013 08:26:57 AM (11 years ago)
Author:
dd32
Message:

Make use of the mbstring.func_overload helper functions in WP_Filesystem so byte lengths are properly determined. See #25259 Fixes #25237

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-direct.php

    r25305 r25349  
    6969            return false;
    7070
     71        mbstring_binary_safe_encoding();
     72
     73        $data_length = strlen( $contents );
     74
    7175        $bytes_written = fwrite( $fp, $contents );
    7276
     77        reset_mbstring_encoding();
     78
    7379        fclose( $fp );
    7480
    75         if ( false === $bytes_written || $bytes_written != strlen( $contents ) )
     81        if ( $data_length !== $bytes_written )
    7682            return false;
    7783
Note: See TracChangeset for help on using the changeset viewer.