Project

General

Profile

Actions

Bug #88368

closed

Invalid ts constants in symfony expression functions throw no exception in strict syntax mode

Added by Christian Eßl over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-05-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If I use a symfony expression condition and try to use a ts constant that does not exist, the condition is never executed.

Example:

[loginUser({$foo.nonExistingProperty})]
// this is never executed
[end]

After debugging in TYPO3\CMS\Core\ExpressionLanguage\Resolver::evalue() I found out, that because the ts constant couldn't be resolved, the expression language still got {$foo.nonExistingProperty} as a parameter and threw a SyntaxError that is silently caught.

Strict syntax mode for typoscript is enabled in the feature toggles and I checked the code AbstractConditionMatcher class. - There is some error handling, that is supposed to throw a InvalidTypoScriptConditionException in "strict mode" for some conditions like [1 in "foo"] or ["bar" in "foo,baz"]. In my example case, where the syntax error is a parameter inside a function like loginUser, the syntax error exception remains silent and the condition is just ignored. So I suppose this is a bug?

Actions

Also available in: Atom PDF