[BUGFIX] Throw exception in case FileWriter's logFile is invalid 36/58036/2
authorOliver Hader <oliver@typo3.org>
Fri, 24 Aug 2018 16:23:19 +0000 (18:23 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 25 Aug 2018 12:04:00 +0000 (14:04 +0200)
GeneralUtility::getFileAbsFileName($logFile) never results in `null`,
but in some empty string in case the $logFile is invalid.

Resolves: #85973
Releases: master, 8.7
Change-Id: I2890bbf172c8f540dd2fa2775a9479d5c644b172
Reviewed-on: https://review.typo3.org/58036
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Log/Writer/FileWriter.php

index 271129c..ec52c68 100644 (file)
@@ -86,7 +86,7 @@ class FileWriter extends AbstractWriter
         // Skip handling if logFile is a stream resource. This is used by unit tests with vfs:// directories
         if (false === strpos($logFile, '://') && !PathUtility::isAbsolutePath($logFile)) {
             $logFile = GeneralUtility::getFileAbsFileName($logFile);
-            if ($logFile === null) {
+            if (empty($logFile)) {
                 throw new InvalidLogWriterConfigurationException('Log file path "' . $relativeLogFile . '" is not valid!', 1444374805);
             }
         }