-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHP8.1 deprecation warnings on null string in modifiers #834
Conversation
Didn't we do this recently in a huge PR? Or did that not include modifiers & functions? It seems inefficient to do every modifier/function separately like this and d304d34 and more. On the other hand, I don't even run 8.1 yet, so I'm not going to fix all of them =) so you can safely ignore me. |
I didn't see it on |
I added some more casts to modifiers that were probably left out previously, it should all be good now :) |
Prevents E_DEPRECATED: mb_strlen(): Passing null to parameter smarty-php#1 ($string) of type string is deprecated
We've been using this in production for some time now, it works fine. We would love to see it merged and released so we can drop our internal fork :) |
No problem! Thank you for your contribution. |
Thanks for the merge! |
I noticed that if one is calling
|truncate
on null, it triggersE_DEPRECATED: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
on PHP 8.1.This is expected, but given the modifier accepts null we may as well return an empty string before calling the function.