From 4f72f04edab358e34d2bfeef0ffff74b2f302b97 Mon Sep 17 00:00:00 2001 From: jeldrik <> Date: Sat, 28 Sep 2013 13:39:38 +0200 Subject: [PATCH] Prevent inconstitent /data/trafic_limiter.php due to file read while writing (cherry picked from commit 71a7f6adaea9a86a84fa8ebbcb9e5c506a785527) Conflicts: index.php --- lib/persistence.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/persistence.php b/lib/persistence.php index 2b145435..281d3add 100644 --- a/lib/persistence.php +++ b/lib/persistence.php @@ -105,7 +105,7 @@ abstract class persistence { self::_initialize(); $file = self::$_path . '/' . $filename; - file_put_contents($file, $data); + file_put_contents($file, $data, LOCK_EX); chmod($file, 0705); return $file; }