// Smarty fix bugs with php version < 5.2.3

This commit is contained in:
mDeflotte
2012-07-03 09:07:33 +00:00
parent d4ef18cdfe
commit 4d7bbf217a
2 changed files with 26 additions and 0 deletions
+4
View File
@@ -48,7 +48,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $
}
// no MBString fallback
/* PrestaShop
return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);
*/
return htmlentities($string, ENT_QUOTES, $char_set);
/* END */
case 'url':
return rawurlencode($string);
@@ -36,12 +36,19 @@ function smarty_modifiercompiler_escape($params, $compiler)
switch ($esc_type) {
case 'html':
/* PrestaShop
return 'htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
. var_export($double_encode, true) . ')';
*/
return 'htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ')';
/* END */
case 'htmlall':
/* PrestaShop
if (Smarty::$_MBSTRING) {
return 'mb_convert_encoding(htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
@@ -50,12 +57,27 @@ function smarty_modifiercompiler_escape($params, $compiler)
. '), "HTML-ENTITIES", '
. var_export($char_set, true) . ')';
}
*/
if (Smarty::$_MBSTRING) {
return 'mb_convert_encoding(htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true)
. '), "HTML-ENTITIES", '
. var_export($char_set, true) . ')';
}
/* END */
// no MBString fallback
/* PrestaShop
return 'htmlentities('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
. var_export($double_encode, true) . ')';
*/
return 'htmlentities('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ')';
/* END */
case 'url':
return 'rawurlencode(' . $params[0] . ')';