- changed internals to use Smarty::$_MBSTRING ($_CHARSET, $_DATE_FORMAT) for better unit testing

This commit is contained in:
rodneyrehm
2011-12-18 18:20:09 +00:00
parent 23a924cebe
commit d645ad2ea1
22 changed files with 69 additions and 55 deletions

View File

@@ -19,7 +19,7 @@
*/
function smarty_modifiercompiler_from_charset($params, $compiler)
{
if (!SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) {
if (!Smarty::$_MBSTRING) {
// FIXME: (rodneyrehm) shouldn't this throw an error?
return $params[0];
}
@@ -28,7 +28,7 @@ function smarty_modifiercompiler_from_charset($params, $compiler)
$params[1] = '"ISO-8859-1"';
}
return 'mb_convert_encoding(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET, ' . $params[1] . ')';
return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')';
}
?>