The Regex used in the FroshProfiler\Components\BlockAnnotation\BlockSplitter class also recognizes {block} tags which are commented out. For example if {*{/block}*} is somewhere in a template the BlockSpliltter will incorrectly think that the current block is closed. Which causes one of the real block tags to be unmatched, which causes an exception on line 42 because $element['start'] or $element['end'] will be null. If Smarty has some APIs to access an Abstract Syntax Tree representation of the template or something similar, maybe this Regex issue could be avoided.
Expected behaviour
The BlockSplitter should ignore commented out template code.
PHP Version
7.4
Shopware Version
5.7.4
Actual behaviour
The Regex used in the
FroshProfiler\Components\BlockAnnotation\BlockSplitter
class also recognizes{block}
tags which are commented out. For example if{*{/block}*}
is somewhere in a template the BlockSpliltter will incorrectly think that the current block is closed. Which causes one of the real block tags to be unmatched, which causes an exception on line 42 because$element['start']
or$element['end']
will be null. If Smarty has some APIs to access an Abstract Syntax Tree representation of the template or something similar, maybe this Regex issue could be avoided.Expected behaviour
The
BlockSplitter
should ignore commented out template code.Steps to Reproduce?
{*{/block}*}
in an otherwise valid template