Issue Bug Closed

#72936It's not possible to use '0' as userFunc argument in TypoScript

Gernot Leitgab 01/25/16, 18:45 updated 10/02/18, 11:20

Description

If ‘0’ is used as an argument, the user function is triggered with an empty array.

Example:

[userFunc = \Vendor\UserFunc\ClassName::methodName(0)] 
  [...]
[global]

To fix this issue the line

$funcValues = $matches[2][0] ? $this->parseUserFuncArguments($matches[2][0]) : array();

has to be changed to

$funcValues = $matches[2][0] !== '' ? $this->parseUserFuncArguments($matches[2][0]) : array();

in file EXT:core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php

Reviews 3