[BUGFIX] Avoid unnecessary I/O in GeneralUtility::createVersionNumberedFilename() 38/54238/2
authorFaton Haliti <fha@systime.dk>
Wed, 27 Sep 2017 07:56:13 +0000 (09:56 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 29 Sep 2017 16:14:36 +0000 (18:14 +0200)
With this commit we prevent to check for existence of file
when we don't need to, because mode is not either 'embed' or
'querystring'

Resolves: #82565
Releases: master, 8.7
Change-Id: I829b8e87d951a6f170bc03d8b7836f671b51bdf4
Reviewed-on: https://review.typo3.org/54238
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index e11f354..9dd6ca9 100644 (file)
@@ -2694,7 +2694,7 @@ class GeneralUtility
         } else {
             $mode = $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['versionNumberInFilename'];
         }
-        if (!file_exists($path) || $doNothing) {
+        if ($doNothing || !file_exists($path)) {
             // File not found, return filename unaltered
             $fullName = $file;
         } else {