- Timestamp:
- 09/09/2013 02:42:52 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r25274 r25304 76 76 } 77 77 78 $this->ftp->SetType( FTP_AUTOASCII);79 $this->ftp->Passive( true);80 $this->ftp->setTimeout( FS_TIMEOUT);78 $this->ftp->SetType( FTP_BINARY ); 79 $this->ftp->Passive( true ); 80 $this->ftp->setTimeout( FS_TIMEOUT ); 81 81 return true; 82 82 } 83 83 84 function get_contents( $file, $type = '', $resumepos = 0) {84 function get_contents( $file ) { 85 85 if ( ! $this->exists($file) ) 86 86 return false; 87 88 if ( empty($type) )89 $type = FTP_AUTOASCII;90 $this->ftp->SetType($type);91 87 92 88 $temp = wp_tempnam( $file ); … … 123 119 } 124 120 125 fwrite($temphandle, $contents); 126 fseek($temphandle, 0); //Skip back to the start of the file being written to 127 128 $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; 129 $this->ftp->SetType($type); 121 $bytes_written = fwrite( $temphandle, $contents ); 122 if ( false === $bytes_written || $bytes_written != strlen( $contents ) ) { 123 fclose( $temphandle ); 124 unlink( $temp ); 125 return false; 126 } 127 128 fseek( $temphandle, 0 ); // Skip back to the start of the file being written to 130 129 131 130 $ret = $this->ftp->fput($file, $temphandle);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)