[BUGFIX] Throw exception in case FileWriter's logFile is invalid 31/58031/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 11:44:39 +0000 (13:44 +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/58031
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Log/Writer/FileWriter.php

index cbc1fbf..7f43ed5 100644 (file)
@@ -113,7 +113,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