Duplicate Non-functional <xf:if>

Xon

Well-known member
Licensed customer
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
 
Automated triage: Duplicate

Thank you for reporting this issue. This is the same problem as an earlier report that is still open: when a condition and content checking are both set on one if tag, the condition is silently dropped without an error. It will be tracked there.

Duplicate of: https://xenforo.com/community/threads/211305/

This is an automated assessment. A member of staff may review and update it.
 
Back
Top Bottom