[TASK] Fix superfluous strlen() on constant strings 43/25243/2
authorSteffen Ritter <info@rs-websystems.de>
Sat, 9 Nov 2013 21:41:29 +0000 (22:41 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Sat, 9 Nov 2013 21:48:47 +0000 (22:48 +0100)
Releases: 6.2, 6.1, 6.0
Resolves: #53477
Change-Id: I27817df25c126beb216c2b933c82ad9c35b74d80
Reviewed-on: https://review.typo3.org/25243
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php

index 8b16dc3..ac9e3a0 100644 (file)
@@ -477,7 +477,7 @@ class SystemEnvironmentBuilder {
         * @return string Absolute path to document root of installation
         */
        static protected function getPathSiteByTypo3ModulePath() {
-               if (substr(TYPO3_MOD_PATH, 0, strlen('sysext/')) === 'sysext/' || substr(TYPO3_MOD_PATH, 0, strlen('ext/')) === 'ext/' || substr(TYPO3_MOD_PATH, 0, strlen('install/')) === 'install/') {
+               if (substr(TYPO3_MOD_PATH, 0, 7) === 'sysext/' || substr(TYPO3_MOD_PATH, 0, 4) === 'ext/' || substr(TYPO3_MOD_PATH, 0, 8) === 'install/') {
                        $pathPartRelativeToDocumentRoot = TYPO3_mainDir . TYPO3_MOD_PATH;
                } elseif (substr(TYPO3_MOD_PATH, 0, strlen('../typo3conf/')) === '../typo3conf/') {
                        $pathPartRelativeToDocumentRoot = substr(TYPO3_MOD_PATH, 3);
@@ -521,4 +521,4 @@ class SystemEnvironmentBuilder {
 }
 
 
-?>
\ No newline at end of file
+?>