[Tiki-devel] Using php-function "strstr" as a modifier is deprecated

Bernard Sfez via TikiWiki-devel <[email protected]> Fri, 4 Aug 2023 00:00:51 +0300
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <[email protected]>
Hello,

Some of us uses php-function inside Smarty template but since Tiki25 and Tiki26 (Smarty4 and PHP8) this method has been deprecated.

DEPRECATED: Using php-function "strstr" as a modifier is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier.

I thought it was trivial and already solved somewhere, but I understood that it isn’t. (https://github.com/smarty-php/smarty/issues/813)

So for my own Tiki I created lib/smarty_tiki/modifier.contains.php using “str_contains” function as explained here: https://www.php.net/manual/en/function.str-contains.php
However, I couldn’t find a real guide on how to create a marty_tiki modifier (I open several others) and may be we need a generic solution for this function (JonnyB) and others may have already started something.

Any thought on how we can organise a smart way in Tiki with this ?

Bernard

_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel