[RSS Feed/News] <xf:set casting

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
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:
HTML:

Code:
<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...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom