Page 1 of 1

Permissive Smarty - Deprecated warning

Posted: Sat Jun 15, 2024 5:18 am
by wentybloke
I use Permissive Smarty to include PHP functions in some page templates and also some Gallery templates. It is now putting entries like this in the error log, for example when I use getimagesize() to stop PageSpeed complaining about missing width & height in img tags:

[02-Jun-2024 15:45:50 Australia/Sydney] PHP Deprecated: Using unregistered function "getimagesize" in a template is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. in /home/lorikeet/public_html/avaloncraftcottage.com.au/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 651

Obviously nothing is actually broken yet. But it does clutter up the error logs, so that I have to regularly clear them. I have attempted to use registerPlugin to fix the problem but I haven't been able to get the syntax right. Does anyone know?

Re: Permissive Smarty - Deprecated warning

Posted: Sat Jun 15, 2024 12:40 pm
by DIGI3
See viewtopic.php?t=84080 for a similar discussion.

Re: Permissive Smarty - Deprecated warning

Posted: Sat Jun 15, 2024 1:05 pm
by wentybloke
Thank you, so - configuring PHP error reporting in .htaccess to omit notices will get rid of my error log bloat for now, pending a Dev Team decision on the way ahead.

Re: Permissive Smarty - Deprecated warning

Posted: Sat Jun 15, 2024 1:10 pm
by DIGI3
deprecated is a different setting than notice, but yes that's correct. Production sites generally should have those suppressed from logging anyway, just enable them on your dev sites.