pegasus
Well-known member
@XF Bug Bot, I should point out that XF\Template\Templater::fnTrim also sometimes throws this message because the method does not ensure that the incoming template text in $str has been cast to string (occasionally a {$...|raw} may not have been passed, may be an integer, etc).
The new method should be:
Also, in XF\Template\Compiler\Trim, it should call $templater->fnTrim and not trim directly, or if the escaping is a problem, XF\Templater\Compiler\Trim should also make sure that $valueHtml is cast:
The new method should be:
Code:
public function fnTrim($templater, &$escape, $str, $charlist = " \t\n\r\0\x0B")
{
$str = (string)$str;
return trim($str, $charlist);
}
Code:
return "trim((string){$valueHtml})";
Last edited: