Skip to content

Commit 63be394

Browse files
committed
Handle file permissions
1 parent c51e462 commit 63be394

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

engine/_classes/class.settings.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ private function saveDo($settingsCopy)
7575

7676
// Use append flag ('a'), so we wouldn't delete the file, before lock
7777
$fp = fopen($xml_file, 'a');
78+
79+
if (! $fp) {
80+
throw new \Exception('Could not open file for writing: ' . $xml_file);
81+
}
82+
7883
if (flock($fp, LOCK_EX)) {
7984
// Clear the file once we have the lock
8085
ftruncate($fp, 0);

0 commit comments

Comments
 (0)