- Timestamp:
- 01/14/2010 09:23:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r12104 r12723 116 116 } 117 117 118 function put_contents($file, $contents, $type = '' ) { 119 if ( empty($type) ) 120 $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; 121 122 $this->ftp->SetType($type); 123 118 function put_contents($file, $contents, $mode = false ) { 124 119 $temp = wp_tempnam( $file ); 125 if ( ! $temphandle = fopen($temp, 'w+') ) {120 if ( ! $temphandle = @fopen($temp, 'w+') ) { 126 121 unlink($temp); 127 122 return false; … … 131 126 fseek($temphandle, 0); //Skip back to the start of the file being written to 132 127 128 $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; 129 $this->ftp->SetType($type); 130 133 131 $ret = $this->ftp->fput($file, $temphandle); 134 132 135 133 fclose($temphandle); 136 134 unlink($temp); 135 136 $this->chmod($file, $mode); 137 137 138 return $ret; 138 139 }
Note: See TracChangeset
for help on using the changeset viewer.