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:
Dion Hulse
2010-01-14 09:23:53 +00:00
parent c1f8977b95
commit 76592af8d8
5 changed files with 24 additions and 19 deletions
@@ -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);