forked from halo-battle/game
Update Smarty to v2.6.31 (fix compatibility with PHP 7.2)
This commit is contained in:
parent
aebcb5b82b
commit
f88f9499d0
400 changed files with 3366 additions and 49622 deletions
|
|
@ -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: */
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue