Update Smarty to v2.6.31 (fix compatibility with PHP 7.2)

This commit is contained in:
nemunaire 2020-11-15 17:12:18 +01:00
commit f88f9499d0
400 changed files with 3366 additions and 49622 deletions

View file

@ -2,7 +2,7 @@
/**
* Smarty plugin
* @package Smarty
* @subpackage PluginsModifier
* @subpackage plugins
*/
@ -20,6 +20,14 @@
*/
function smarty_modifier_count_words($string)
{
return str_word_count($string);
// split text by ' ',\r,\n,\f,\t
$split_array = preg_split('/\s+/',$string);
// count matches that contain alphanumerics
$word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);
return count($word_count);
}
/* vim: set expandtab: */
?>