WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/14/2010 09:23:53 AM (12 years ago)
Author:
dd32
Message:

Standardise WP_Filesystem_*::put_contents() arguments to support chmod reliably across all transports. Fixes #10889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r12369 r12723  
    112112        return explode("\n", $this->get_contents($file));
    113113    }
    114     function put_contents($file, $contents, $type = '' ) {
    115         if ( empty($type) )
    116             $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
    117 
     114   
     115    function put_contents($file, $contents, $mode = false ) {
    118116        $temp = tmpfile();
    119117        if ( ! $temp )
     
    123121        fseek($temp, 0); //Skip back to the start of the file being written to
    124122
     123        $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
    125124        $ret = @ftp_fput($this->link, $file, $temp, $type);
    126125
    127126        fclose($temp);
     127
     128        $this->chmod($file, $mode);
     129
    128130        return $ret;
    129131    }
Note: See TracChangeset for help on using the changeset viewer.