diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-10-11 23:42:28 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-10-11 23:42:28 +0300 |
commit | cca8b3c72d8a9ea98723cdad3b9714b085e04086 (patch) | |
tree | f0853140721328afbd68e34051d3767e3d235b47 | |
parent | cdbf944146cea42a4725eb9fa814c51c7b32b17b (diff) |
Acquire an exclusive lock when writing config file (#13583)
Avoids a config file end up empty under circumstances
-rw-r--r-- | core/Config.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/Config.php b/core/Config.php index e47cd2f150..c70d75f1e0 100644 --- a/core/Config.php +++ b/core/Config.php @@ -387,7 +387,7 @@ class Config // simulate whether it would be successful $success = is_writable($localPath); } else { - $success = @file_put_contents($localPath, $output); + $success = @file_put_contents($localPath, $output, LOCK_EX); } if ($success === false) { |