Non-functional <xf:if>

Xon

Well-known member
Affected version
2.2.15
XF's template syntax supports <xf:if contentcheck="true"> and <xf:if contentcheck="true" is="$test1">.

However combining them doesn't work or give an error.

The following:
XML:
<xf:if contentcheck="true" is="$test1">
    <xf:contentcheck>{$test2}</xf:contentcheck>
</xf:if>
Compiles to:
PHP:
return array(
'code' => function($__templater, array $__vars, $__extensions = null)
{
    $__finalCompiled = '';
    $__compilerTemp1 = '';
    $__compilerTemp1 .= $__templater->escape($__vars['test2']);
    if (strlen(trim($__compilerTemp1)) > 0) {
        $__finalCompiled .= '
    ' . $__compilerTemp1 . '
';
    }
    return $__finalCompiled;
}
);
I've also caught it sometimes compiling the is="$test" bit instead of the contentcheck="true".

This should error since this isn't supported in any previous supported version, and has very unexpected failure modes
 
Top Bottom