|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
lsces Smarty Rookie
Joined: 03 Dec 2011 Posts: 8
|
Posted: Sun Feb 07, 2016 1:07 pm Post subject: PHP typing complaint |
|
|
Having been using Smarty happily on PHP5.2 for many years, I've given in and as well as testing everything on PHP7 I'm tidying up the libraries and pulling in the latest versions. After a few problems I now have a working 'modern' setup, but with a few bugs.
Warning: preg_replace() expects parameter 4 to be integer, string given in /srv/website/externals/smarty/libs/plugins/modifier.regex_replace.php on line 36
The default for parameter 4 is -1, but when used in a cached template, a blank string is used. I've not tracked back to where it is generated, but with all the excessive nannying in PHP these days, little niggles like this are now the norm and while one could switch off warnings, THAT is the source of a much bigger can of worms as has resulted from changes since PHP5.2.
I've not worked out yet where the limit value would be populated in smarty, so switching the blank sting to -1 is probably a cleaner solution for now? That is if I could find where it's set |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Sun Feb 07, 2016 1:50 pm Post subject: |
|
|
Can you show a source example (YOUR modifier call)? |
|
Back to top |
|
lsces Smarty Rookie
Joined: 03 Dec 2011 Posts: 8
|
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
|
Back to top |
|
lsces Smarty Rookie
Joined: 03 Dec 2011 Posts: 8
|
Posted: Mon Feb 22, 2016 11:40 am Post subject: |
|
|
Yes rewriting the templates is a solution, but 'regex_replace' is a smarty function and has a problem when used with PHP7. That still needs fixing ... |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Mon Feb 22, 2016 11:44 am Post subject: |
|
|
In Smarty 3 you can use some PHP commands direcly inside templates. There's no longer need to use modificators . |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|