[BUGFIX] User proper Fluid namespace detection 49/47549/9
authorBenni Mack <benni@typo3.org>
Tue, 12 Apr 2016 10:55:14 +0000 (12:55 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Wed, 13 Apr 2016 08:01:02 +0000 (10:01 +0200)
commit060186b7ea1070221a26071538fcb354b48fdb47
tree295ee5985f06c766f0dbb84227a22d0640ee68fa
parent0d9a541edb04521e36aa5542a026d353c5836efc
[BUGFIX] User proper Fluid namespace detection

The Fluid namespaces can be put in short-syntax, and in tags to be
resolved. However, if the template source is very large, then
preg_match_all() stops and returns "0" although the matched values are
within $matches. However, the $matched result is "0".

The regular expression for doing so, is very exhaustive and greedy, and
uses preg_match_all() however, preg_match() does the job as well.

Additionally, the regular expression is changed to be less
greedy (using *?).

An example where this is necessary is the FileList search module where
the additional namespaces are not resolved currently and the core icons
are not shown, because of the memory - exhausting regular expression.

Change-Id: Ia685091fe9fbcbb1520415ee5d48925852d1a400
Resolves: #75464
Releases: master
Reviewed-on: https://review.typo3.org/47549
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
typo3/sysext/fluid/Classes/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessor.php
typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestNamespaceTemplateBig.html [new file with mode: 0644]
typo3/sysext/fluid/Tests/Unit/Core/Fixtures/TestNamespaceTemplateBigExpectedResult.html [new file with mode: 0644]
typo3/sysext/fluid/Tests/Unit/Core/Parser/PreProcessor/XmlnsNamespaceTemplatePreProcessorTest.php