~canonical-sysadmins/wordpress/4.7.2

« back to all changes in this revision

Viewing changes to wp-admin/includes/class-wp-filesystem-ftpext.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
                        unlink( $tempfile );
121
121
                        return false;
122
122
                }
123
 
                
 
123
 
124
124
                if ( ! @ftp_fget( $this->link, $temp, $file, FTP_BINARY ) ) {
125
125
                        fclose( $temp );
126
126
                        unlink( $tempfile );
127
127
                        return false;
128
128
                }
129
 
                
 
129
 
130
130
                fseek( $temp, 0 ); // Skip back to the start of the file being written to
131
131
                $contents = '';
132
132
 
159
159
        public function put_contents($file, $contents, $mode = false ) {
160
160
                $tempfile = wp_tempnam($file);
161
161
                $temp = fopen( $tempfile, 'wb+' );
162
 
                if ( ! $temp )
 
162
 
 
163
                if ( ! $temp ) {
 
164
                        unlink( $tempfile );
163
165
                        return false;
 
166
                }
164
167
 
165
168
                mbstring_binary_safe_encoding();
166
169