Config - fix file open mode in overwrite(), to prevent trying to open a lock on a boolean.

This is a bit of an edge case, but when someone removes /conf/config.xml and backups exists, we can not construct a config object anymore.
This commit is contained in:
Ad Schellevis 2024-10-15 15:26:25 +02:00
parent 7eb9e3f541
commit 07985a3db3

View File

@ -626,7 +626,7 @@ class Config extends Singleton
*/
private function overwrite($filename)
{
$fhandle = fopen($this->config_file, "r+");
$fhandle = fopen($this->config_file, "a+e");
if (flock($fhandle, LOCK_EX)) {
fseek($fhandle, 0);
chmod($this->config_file, 0640);