[BUGFIX] Do not cut constants in debug output 03/50303/2
authorSascha Egerer <sascha@sascha-egerer.de>
Thu, 29 Sep 2016 07:13:08 +0000 (09:13 +0200)
committerBenni Mack <benni@typo3.org>
Fri, 21 Oct 2016 08:36:17 +0000 (10:36 +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/50303
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/TypoScript/TemplateService.php

index 7bd85b1..84adbf9 100644 (file)
@@ -1011,16 +1011,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);
                 }
             }
         }