Skip to content

Commit

Permalink
[BUGFIX] Check isAbsPath when creating log file
Browse files Browse the repository at this point in the history
As Windows uses for example "D:" as path prefix
the log file writer fails to recognize it as valid
local file path and skips creation of the log file.
To allow usage on Windows, isAbsPath is now used to
check the file path - if it is a valid absPath it
is handled in the same way as all other local files.

Resolves: #90116
Releases: master, 9.5
Change-Id: I499eb4cba4b89f8ed6a8f280e9bb8493fa3de0f9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62914
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
susannemoog authored and bmack committed Jan 15, 2020
1 parent f752085 commit 350f2a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Log/Writer/FileWriter.php
Expand Up @@ -219,7 +219,7 @@ protected function createLogFile()

// skip mkdir if logFile refers to any scheme but vfs://, file:// or empty
$scheme = parse_url($this->logFile, PHP_URL_SCHEME);
if ($scheme === null || $scheme === 'file' || $scheme === 'vfs') {
if ($scheme === null || $scheme === 'file' || $scheme === 'vfs' || GeneralUtility::isAbsPath($this->logFile)) {
// remove file:/ before creating the directory
$logFileDirectory = PathUtility::dirname(preg_replace('#^file:/#', '', $this->logFile));
if (!@is_dir($logFileDirectory)) {
Expand Down

0 comments on commit 350f2a6

Please sign in to comment.