diff options
Diffstat (limited to 'libs/plugins/modifiercompiler.upper.php')
| -rw-r--r-- | libs/plugins/modifiercompiler.upper.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/plugins/modifiercompiler.upper.php b/libs/plugins/modifiercompiler.upper.php index 2869b879..739057ce 100644 --- a/libs/plugins/modifiercompiler.upper.php +++ b/libs/plugins/modifiercompiler.upper.php @@ -20,11 +20,11 @@ */
function smarty_modifiercompiler_upper($params, $compiler)
{
- if (function_exists('mb_strtoupper')) {
- return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? mb_strtoupper(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET) : strtoupper(' . $params[0] . '))' ;
- } else {
- return 'strtoupper(' . $params[0] . ')';
- }
+ if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) {
+ return 'mb_strtoupper(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET)' ;
+ }
+ // no MBString fallback
+ return 'strtoupper(' . $params[0] . ')';
}
?>
\ No newline at end of file |
