Changeset 25349
- Timestamp:
- 09/11/2013 08:26:57 AM (11 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-direct.php
r25305 r25349 69 69 return false; 70 70 71 mbstring_binary_safe_encoding(); 72 73 $data_length = strlen( $contents ); 74 71 75 $bytes_written = fwrite( $fp, $contents ); 72 76 77 reset_mbstring_encoding(); 78 73 79 fclose( $fp ); 74 80 75 if ( false === $bytes_written || $bytes_written != strlen( $contents ))81 if ( $data_length !== $bytes_written ) 76 82 return false; 77 83 -
trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r25305 r25349 119 119 return false; 120 120 121 mbstring_binary_safe_encoding(); 122 123 $data_length = strlen( $contents ); 121 124 $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 ) { 123 129 fclose( $temp ); 124 130 unlink( $tempfile ); -
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r25305 r25349 90 90 return false; 91 91 92 mbstring_binary_safe_encoding(); 93 92 94 if ( ! $this->ftp->fget($temphandle, $file) ) { 93 95 fclose($temphandle); 94 96 unlink($temp); 97 98 reset_mbstring_encoding(); 99 95 100 return ''; // Blank document, File does exist, It's just blank. 96 101 } 102 103 reset_mbstring_encoding(); 97 104 98 105 fseek( $temphandle, 0 ); // Skip back to the start of the file being written to … … 118 125 } 119 126 127 // The FTP class uses string functions internally during file download/upload 128 mbstring_binary_safe_encoding(); 129 120 130 $bytes_written = fwrite( $temphandle, $contents ); 121 131 if ( false === $bytes_written || $bytes_written != strlen( $contents ) ) { 122 132 fclose( $temphandle ); 123 133 unlink( $temp ); 134 135 reset_mbstring_encoding(); 136 124 137 return false; 125 138 } … … 128 141 129 142 $ret = $this->ftp->fput($file, $temphandle); 143 144 reset_mbstring_encoding(); 130 145 131 146 fclose($temphandle); … … 294 309 } 295 310 311 mbstring_binary_safe_encoding(); 312 296 313 $list = $this->ftp->dirlist($path); 297 if ( empty($list) && !$this->exists($path) ) 298 return false; 314 if ( empty( $list ) && ! $this->exists( $path ) ) { 315 316 reset_mbstring_encoding(); 317 318 return false; 319 } 299 320 300 321 $ret = array(); … … 323 344 $ret[ $struc['name'] ] = $struc; 324 345 } 346 347 reset_mbstring_encoding(); 348 325 349 return $ret; 326 350 }
Note: See TracChangeset
for help on using the changeset viewer.