]> git.mxchange.org Git - friendica.git/commitdiff
avoid exception throwing because of false-like return
authornupplaPhil <admin@philipp.info>
Fri, 17 Jan 2020 19:45:21 +0000 (20:45 +0100)
committernupplaPhil <admin@philipp.info>
Fri, 17 Jan 2020 22:55:17 +0000 (23:55 +0100)
src/Model/Storage/Filesystem.php

index 9c429cfb3cf7afb5d1206690b8b12f58706bda45..f45e1db44971c030efd1cc0a16723878465b6199 100644 (file)
@@ -125,7 +125,10 @@ class Filesystem extends AbstractStorage
 
                $this->createFoldersForFile($file);
 
-               if (!file_put_contents($file, $data)) {
+               $result = file_put_contents($file, $data);
+
+               // just in case the result is REALLY false, not zero or empty or anything else, throw the exception
+               if ($result === false) {
                        $this->logger->warning('Failed to write data.', ['file' => $file]);
                        throw new StorageException($this->l10n->t('Filesystem storage failed to save data to "%s". Check your write permissions', $file));
                }