fixing typo in comments

This commit is contained in:
rodneyrehm
2012-08-14 13:18:24 +00:00
parent b069c08eb4
commit b921a7657d
2 changed files with 8 additions and 8 deletions

View File

@@ -39,10 +39,10 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $
return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);
} else {
if ($double_encode) {
// php <5.3.2 - only handle double encoding
// php <5.2.3 - only handle double encoding
return htmlspecialchars($string, ENT_QUOTES, $char_set);
} else {
// php <5.3.2 - prevent double encoding
// php <5.2.3 - prevent double encoding
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
$string = htmlspecialchars($string, ENT_QUOTES, $char_set);
$string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
@@ -58,10 +58,10 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $
$string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);
} else {
if ($double_encode) {
// php <5.3.2 - only handle double encoding
// php <5.2.3 - only handle double encoding
$string = htmlspecialchars($string, ENT_QUOTES, $char_set);
} else {
// php <5.3.2 - prevent double encoding
// php <5.2.3 - prevent double encoding
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
$string = htmlspecialchars($string, ENT_QUOTES, $char_set);
$string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);

View File

@@ -57,7 +57,7 @@ function smarty_modifiercompiler_escape($params, $compiler)
case 'htmlall':
if (Smarty::$_MBSTRING) {
if ($_double_encode) {
// php >=5.3.2 - go native
// php >=5.2.3 - go native
return 'mb_convert_encoding(htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
@@ -65,7 +65,7 @@ function smarty_modifiercompiler_escape($params, $compiler)
. '), "HTML-ENTITIES", '
. var_export($char_set, true) . ')';
} else if ($double_encode) {
// php <5.3.2 - only handle double encoding
// php <5.2.3 - only handle double encoding
return 'mb_convert_encoding(htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true)
@@ -78,13 +78,13 @@ function smarty_modifiercompiler_escape($params, $compiler)
// no MBString fallback
if ($_double_encode) {
// php >=5.3.2 - go native
// php >=5.2.3 - go native
return 'htmlentities('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
. var_export($double_encode, true) . ')';
} else if ($double_encode) {
// php <5.3.2 - only handle double encoding
// php <5.2.3 - only handle double encoding
return 'htmlentities('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ')';