mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 11:16:57 +00:00
Avoid file_put_contents() when overwriting files
this fixes many cases of corruption during disk-full situations - file_put_contents() would write an empty file, destroying the original data. fixes #3152
This commit is contained in:
@ -33,7 +33,6 @@ use function date;
|
||||
use function explode;
|
||||
use function file_exists;
|
||||
use function file_get_contents;
|
||||
use function file_put_contents;
|
||||
use function implode;
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
@ -228,7 +227,7 @@ class Config{
|
||||
throw new AssumptionFailedError("Config type is unknown, has not been set or not detected");
|
||||
}
|
||||
|
||||
file_put_contents($this->file, $content);
|
||||
Filesystem::safeFilePutContents($this->file, $content);
|
||||
|
||||
$this->changed = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user