[BUGFIX] Do not cut constants in debug output 63/50063/5
authorSascha Egerer <sascha@sascha-egerer.de>
Thu, 29 Sep 2016 07:13:08 +0000 (09:13 +0200)
committerJan Helke <typo3@helke.de>
Thu, 6 Oct 2016 15:05:58 +0000 (17:05 +0200)
Unsubstituted constants should be logged in full length and not
cut after 50 character.

Resolves: #78107
Releases: master, 7.6
Change-Id: I6a231cbda9f876be390393f8ce967335826e95f4
Reviewed-on: https://review.typo3.org/50063
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/core/Classes/TypoScript/TemplateService.php

index 5a685cf..a990176 100644 (file)
@@ -1061,16 +1061,9 @@ class TemplateService
 
         // Searching for possible unsubstituted constants left (only for information)
         if ($this->verbose) {
-            if (strstr($all, '{$')) {
-                $theConstList = [];
-                $findConst = explode('{$', $all);
-                array_shift($findConst);
-                foreach ($findConst as $constVal) {
-                    $constLen = MathUtility::forceIntegerInRange(strcspn($constVal, '}'), 0, 50);
-                    $theConstList[] = '{$' . substr($constVal, 0, ($constLen + 1));
-                }
+            if (preg_match_all('/\\{\\$.[^}]*\\}/', $all, $constantList) > 0) {
                 if ($this->tt_track) {
-                    $this->getTimeTracker()->setTSlogMessage(implode(', ', $theConstList) . ': Constants may remain un-substituted!!', 2);
+                    $this->getTimeTracker()->setTSlogMessage(implode(', ', $constantList[0]) . ': Constants may remain un-substituted!!', 2);
                 }
             }
         }