1
1
Fork 0

avoid exception throwing because of false-like return

This commit is contained in:
Philipp Holzer 2020-01-17 20:45:21 +01:00
parent 0af83e6f7c
commit 14c97f7b62
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90

View file

@ -125,7 +125,10 @@ class Filesystem extends AbstractStorage
$this->createFoldersForFile($file); $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]); $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)); throw new StorageException($this->l10n->t('Filesystem storage failed to save data to "%s". Check your write permissions', $file));
} }