Solved Template variable filters which are not php 8.1 safe

This topic has been solved
X

Xon

Guest
The following snippet (more realistically from variable usage) will cause a warning in php 8.1+
XML:

{{ null|file_size }}

Will cause this error:
Code:

Template error: [E_DEPRECATED] number_format(): Passing null to parameter #1 ($num) of type float is deprecated

This affects a lot of the filters which handle stringy input that rattles down to an internal php function.

Test cases;
XML:

Code:
{{ null|file_size }}
{{ null|format }}
{{ null|hex }}
{{ null|host }}
{{ null|ip }}
{{ null|number_short }}
{{...

Read more

Continue reading...