WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/11/2013 08:26:57 AM (7 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-ftpext.php

    r25305 r25349  
    119119            return false;
    120120
     121        mbstring_binary_safe_encoding();
     122
     123        $data_length = strlen( $contents );
    121124        $bytes_written = fwrite( $temp, $contents );
    122         if ( false === $bytes_written || $bytes_written != strlen( $contents ) ) {
     125
     126        reset_mbstring_encoding();
     127
     128        if ( $data_length !== $bytes_written ) {
    123129            fclose( $temp );
    124130            unlink( $tempfile );
Note: See TracChangeset for help on using the changeset viewer.