Ticket #16057: 16057.2.diff
File 16057.2.diff, 2.8 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/class-wp-filesystem-direct.php
62 62 function put_contents($file, $contents, $mode = false ) { 63 63 if ( ! ($fp = @fopen($file, 'w')) ) 64 64 return false; 65 @fwrite($fp, $contents);65 $bytes_written = @fwrite($fp, $contents); 66 66 @fclose($fp); 67 if ( false === $bytes_written || is_int($bytes_written) && $bytes_written < strlen($contents) ) { 68 $this->delete($file); 69 return false; 70 } 67 71 $this->chmod($file, $mode); 68 72 return true; 69 73 } -
wp-admin/includes/class-wp-filesystem-ftpext.php
121 121 if ( ! $temp ) 122 122 return false; 123 123 124 fwrite($temp, $contents); 124 $bytes_written = fwrite($temp, $contents); 125 if ( false === $bytes_written || is_int($bytes_written) && $bytes_written < strlen($contents) ) { 126 fclose($temp); 127 unlink($tempfile); 128 return false; 129 } 130 125 131 fseek($temp, 0); //Skip back to the start of the file being written to 126 132 127 133 $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; -
wp-admin/includes/class-wp-filesystem-ftpsockets.php
122 122 return false; 123 123 } 124 124 125 fwrite($temphandle, $contents); 125 $bytes_written = fwrite($temphandle, $contents); 126 if ( false === $bytes_written || is_int($bytes_written) && $bytes_written < strlen($contents) ) { 127 fclose($temphandle); 128 unlink($temp); 129 return false; 130 } 126 131 fseek($temphandle, 0); //Skip back to the start of the file being written to 127 132 128 133 $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; -
wp-admin/includes/file.php
537 537 return new WP_Error('http_404', trim($response['response']['message'])); 538 538 } 539 539 540 fwrite($handle, $response['body']);540 $bytes_written = fwrite($handle, $response['body']); 541 541 fclose($handle); 542 542 543 if ( false === $bytes_written || is_int($bytes_written) && $bytes_written < strlen($response['body']) ) { 544 unlink($tmpfname); 545 return new WP_Error('http_cannot_write', __('Could not write to the temporary file. There may not be enough diskspace.') ); 546 } 547 543 548 return $tmpfname; 544 549 } 545 550