Skip to content
Permalink
Browse files
[plugin:ajaxtree] change fwrite() to file_put_contents()
  • Loading branch information
nao-pon committed Apr 1, 2014
1 parent 75922ec commit 0fd3ac1
Showing 1 changed file with 1 addition and 14 deletions.
@@ -483,20 +483,7 @@ function plugin_ajaxtree_read_file($filename)

function plugin_ajaxtree_write_file($filename, $data)
{
$fp = fopen($filename, is_file($filename) ? 'r+b' : 'wb');
if ($fp === false) {
return false;
}
flock($fp, LOCK_EX);
$last = ignore_user_abort(1);
rewind($fp);
fwrite($fp, $data);
fflush($fp);
ftruncate($fp, ftell($fp));
ignore_user_abort($last);
flock($fp, LOCK_UN);
fclose($fp);
return true;
return file_put_contents($filename, $data, LOCK_EX);
}

function cache_clear() {

0 comments on commit 0fd3ac1

Please sign in to comment.