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 0fd3ac132663ed47ebaf5b831aea8554a4cfaa59
Showing with 1 addition and 14 deletions.
  1. +1 −14 xoops_trust_path/modules/xpwiki/plugin/ajaxtree.inc.php
@@ -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.
You can’t perform that action at this time.