mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-29 18:23:24 +02:00
- check if mb string functions available otherwise fallback to normal string functions
This commit is contained in:
@@ -1,26 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
* @package Smarty
|
||||
* @subpackage PluginsModifier
|
||||
*/
|
||||
|
||||
* Smarty plugin
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage PluginsModifier
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty lower modifier plugin
|
||||
*
|
||||
* Type: modifier<br>
|
||||
* Name: lower<br>
|
||||
* Purpose: convert string to lowercase
|
||||
* @link http://smarty.php.net/manual/en/language.modifier.lower.php
|
||||
* lower (Smarty online manual)
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
* Smarty lower modifier plugin
|
||||
*
|
||||
* Type: modifier<br>
|
||||
* Name: lower<br>
|
||||
* Purpose: convert string to lowercase
|
||||
*
|
||||
* @link http://smarty.php.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @param string $
|
||||
* @return string
|
||||
*/
|
||||
function smarty_modifier_lower($string)
|
||||
{
|
||||
return mb_strtolower($string);
|
||||
}
|
||||
$smarty = Smarty::instance();
|
||||
if ($smarty->has_mb) {
|
||||
return mb_strtolower($string);
|
||||
} else {
|
||||
return strtolower($string);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user