digitalpoint
Well-known member
- Affected version
- 2.2.5
Not entirely sure this is a bug, but it sure gave me some unexpected results. Has to do with a normal comparison operator not casting the variable object to a string, so it compares as "1" (true that it's an object). If you force it to a string with something like trim(), it gives what I would consider the expected results.
Running this test in a template:
Yields this result:
Running this test in a template:
HTML:
<xf:set var="$test">2</xf:set>
<xf:if is="$test == 1">test == 1<br /></xf:if>
<xf:if is="$test == 2">test == 2<br /></xf:if>
<xf:if is="trim($test) == 1">trim(test) == 1<br /></xf:if>
<xf:if is="trim($test) == 2">trim(test) == 2<br /></xf:if>
Yields this result:
Code:
test == 1
trim(test) == 2