Bug Deprecated exception when using trim filter in PHP 8.1

There is a bug in this version
P

pegasus

Guest
@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:
Code:

Code:
	public function fnTrim($templater, &$escape, $str, $charlist = " \t\n\r\0\x0B")
	{
		$str = (string)$str;
		return trim($str, $charlist);
	}
Also, in XF\Template\Compiler\Trim...

Read more

Continue reading...