mirror of
https://github.com/fsr/eseeva
synced 2025-04-28 09:28:31 +02:00
fixes truncation aat write access
This commit is contained in:
parent
3637b0c7b9
commit
db9faaf3d9
2 changed files with 6 additions and 2 deletions
|
@ -109,7 +109,7 @@
|
|||
{
|
||||
if (!isset($fileName) || !isset($keyData))
|
||||
return false;
|
||||
$handle = fopen($fileName, 'w+');
|
||||
$handle = fopen($fileName, 'c');
|
||||
if ($handle == null)
|
||||
return false;
|
||||
// debug code
|
||||
|
@ -122,7 +122,9 @@
|
|||
|
||||
//use exclusive lock for writing
|
||||
flock($handle, LOCK_EX);
|
||||
ftruncate($handle, 0);
|
||||
$res = fwrite($handle, $data);
|
||||
fflush($handle);
|
||||
flock($handle, LOCK_UN);
|
||||
// debug Code
|
||||
//if ($res == false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue