mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-17 23:30:22 +00:00
Standardise WP_Filesystem_*::put_contents() arguments to support chmod reliably across all transports. Fixes #10889
git-svn-id: https://develop.svn.wordpress.org/trunk@12723 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -54,14 +54,13 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Write a string to a file
|
||||
*
|
||||
* @param $file string Path to the file where to write the data.
|
||||
* @param $file string Remote path to the file where to write the data.
|
||||
* @param $contents string The data to write.
|
||||
* @param $mode int (optional) The file permissions as octal number, usually 0644.
|
||||
* @param $type string (optional) Specifies additional type of access you require to the file.
|
||||
* @return bool False upon failure.
|
||||
*/
|
||||
function put_contents($file, $contents, $mode = false, $type = '') {
|
||||
if ( ! ($fp = @fopen($file, 'w' . $type)) )
|
||||
function put_contents($file, $contents, $mode = false ) {
|
||||
if ( ! ($fp = @fopen($file, 'w')) )
|
||||
return false;
|
||||
@fwrite($fp, $contents);
|
||||
@fclose($fp);
|
||||
|
||||
Reference in New Issue
Block a user