On 08/08/2023 version v5.0.0-rc1 was released as an RC version
The future version 5.0.0 will be released soon. A planned evolution for our cms?
At the moment CMSms 2.2.28 is still in Smarty 4.2.1 (14 Sep 2022) while the latest Smarty version is 4.3.4 (14 Sep 2023)?
Smarty Updates
Smarty Updates
Jean-Claude Etiemble MyPageFr
-
- Forum Members
- Posts: 20
- Joined: Mon Apr 11, 2011 7:33 am
Re: Smarty Updates
FYI
Among other changes, Smarty 4.3 deprecates use of PHP functions (built-in or application-defined) as modifiers in templates e.g. {$somestring|md5} even when such is permitted by the Smarty security-policy settings.
One response to that might have been to replace such modifiers with function-calls e.g. {md5($somestring)}, again, if such method is permitted by the security-policy settings.
Another response could be a registered generic modifier-plugin e.g. {$somestring|adjust:'md5'}
Along comes Smarty 5, the current early version of which omits all support for using PHP functions either directly or as a modifier. Unless it's a permitted static method in a class e.g. {class::method($somevar)}
It will probably be possible to individually register each relevant function as a Smarty plugin (up goes the memory usage), but there's no evident way to bulk-enable them.
Might be wise for module-devs etc to think about and prepare for deploying workarounds, in templates and the variables provided to templates.
Or else, some other security mechanism might be substituted for use of Smarty security-policy. If so, need a while to implement and almost certainly going to also need workarounds.
Or else, a massive campaign by users convinces Smarty devs to change the approach.
Or else, CMSMS doesn't go to Smarty 5.
Among other changes, Smarty 4.3 deprecates use of PHP functions (built-in or application-defined) as modifiers in templates e.g. {$somestring|md5} even when such is permitted by the Smarty security-policy settings.
One response to that might have been to replace such modifiers with function-calls e.g. {md5($somestring)}, again, if such method is permitted by the security-policy settings.
Another response could be a registered generic modifier-plugin e.g. {$somestring|adjust:'md5'}
Along comes Smarty 5, the current early version of which omits all support for using PHP functions either directly or as a modifier. Unless it's a permitted static method in a class e.g. {class::method($somevar)}
It will probably be possible to individually register each relevant function as a Smarty plugin (up goes the memory usage), but there's no evident way to bulk-enable them.
Might be wise for module-devs etc to think about and prepare for deploying workarounds, in templates and the variables provided to templates.
Or else, some other security mechanism might be substituted for use of Smarty security-policy. If so, need a while to implement and almost certainly going to also need workarounds.
Or else, a massive campaign by users convinces Smarty devs to change the approach.
Or else, CMSMS doesn't go to Smarty 5.
Re: Smarty Updates
An important and interesting topic!
Could examples like {$somestring|md5} or {md5($somestring)} get migitated with CMSMS's "user defined tags"?
Could examples like {$somestring|md5} or {md5($somestring)} get migitated with CMSMS's "user defined tags"?
Re: Smarty Updates
Too much ado about nothing, in my opinion. We have been having discussions in the Dev Team about the policies we want to adopt, or keep from those we already have, and one is to prevent as much as possible the amount of breakage from one major version to another and, to some extent, what features we want to keep having in CMSMS as a product in the long run. The fact that we use external libraries, such as Smarty, doesn't mean that we are going to stop having the features we are set to keep supporting regardless of what the libraries' developers may have in mind for their own roadmap, and to that extent, at some point our version of Smarty was even a bit modified to be integrated and supported the way we wanted to. That has no longer been the case for some time, but some of the needed mechanisms to allow us to do some customization are still in place so that shouldn't be a worry unless we explicitly announce we are going to deprecate anything ourselves either on our own or to keep inline with the libraries' developers decisions. Integration also means that, if needed, we will support ourselves any modified library to fit our needs, regardless of what the libraries modifications may or may not bring. There are a lot of plans for the next major version of CMSMS and all that will be made public when we are ready to do so. If any of the next versions of CMSMS will break functionalities, that will be extensively publicized, these features will be deprecated with plenty of time for both us and our users base to be able to adapt to new options, that we will make sure that will be available.
Any other considerations about this theme are just conjectures, nothing more. We will keep updating Smarty as needed, not always to the latest version as sometimes versions are not yet mature enough to be usable with CMS Made Simple, but as possible and required. Since we use Smarty even for our installer and it has some very specific requirements to be usable in a number of different environments, there may be times when both libraries will be out of sync in terms of used versions for each.
But as things may change, we will keep our community up to date to what is coming next.
We only ask a bit of patience for now as there is a lot going on.
Thanks
Any other considerations about this theme are just conjectures, nothing more. We will keep updating Smarty as needed, not always to the latest version as sometimes versions are not yet mature enough to be usable with CMS Made Simple, but as possible and required. Since we use Smarty even for our installer and it has some very specific requirements to be usable in a number of different environments, there may be times when both libraries will be out of sync in terms of used versions for each.
But as things may change, we will keep our community up to date to what is coming next.
We only ask a bit of patience for now as there is a lot going on.
Thanks
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Smarty Updates
@Jo Morg: you might want to consider adding Smarty v4.5.2 instead of v4.5.1
https://github.com/smarty-php/smarty/re ... tag/v4.5.2
https://github.com/smarty-php/smarty/re ... tag/v4.5.2
Fixed argument must be passed by reference error introduced in v4.5.1
Re: Smarty Updates
It looks non disruptive enough to warrant a replacement, I'll probably do it if nothing else breaks. Thanks for the heads up.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Smarty Updates
But the Smarty v4.5.2 with the smarty_internal_templatecompilerbase.php modifications (V 2.2.20)you might want to consider adding Smarty v4.5.2 instead of v4.5.1
add Deprecated: Using unregistered function "count" in a template is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. in /lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 649 in several menus
Jean-Claude Etiemble MyPageFr
Re: Smarty Updates
The deprecation notice of the "count()" function has been fixed in version 4.5.4:
https://github.com/smarty-php/smarty/bl ... ANGELOG.md
https://github.com/smarty-php/smarty/bl ... ANGELOG.md