// Smarty fix bugs with php version < 5.2.3
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16184 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
c6038d7e92
commit
d782798926
2 files changed
+26
No files matched your search
@@ -48,7 +48,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
// no MBString fallback
|
// no MBString fallback
|
||||||
|
/* PrestaShop
|
||||||
return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);
|
return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);
|
||||||
|
*/
|
||||||
|
return htmlentities($string, ENT_QUOTES, $char_set);
|
||||||
|
/* END */
|
||||||
|
|
||||||
case 'url':
|
case 'url':
|
||||||
return rawurlencode($string);
|
return rawurlencode($string);
|
||||||
|
|||||||
@@ -36,12 +36,19 @@ function smarty_modifiercompiler_escape($params, $compiler)
|
|||||||
|
|
||||||
switch ($esc_type) {
|
switch ($esc_type) {
|
||||||
case 'html':
|
case 'html':
|
||||||
|
/* PrestaShop
|
||||||
return 'htmlspecialchars('
|
return 'htmlspecialchars('
|
||||||
. $params[0] .', ENT_QUOTES, '
|
. $params[0] .', ENT_QUOTES, '
|
||||||
. var_export($char_set, true) . ', '
|
. var_export($char_set, true) . ', '
|
||||||
. var_export($double_encode, true) . ')';
|
. var_export($double_encode, true) . ')';
|
||||||
|
*/
|
||||||
|
return 'htmlspecialchars('
|
||||||
|
. $params[0] .', ENT_QUOTES, '
|
||||||
|
. var_export($char_set, true) . ')';
|
||||||
|
/* END */
|
||||||
|
|
||||||
case 'htmlall':
|
case 'htmlall':
|
||||||
|
/* PrestaShop
|
||||||
if (Smarty::$_MBSTRING) {
|
if (Smarty::$_MBSTRING) {
|
||||||
return 'mb_convert_encoding(htmlspecialchars('
|
return 'mb_convert_encoding(htmlspecialchars('
|
||||||
. $params[0] .', ENT_QUOTES, '
|
. $params[0] .', ENT_QUOTES, '
|
||||||
@@ -50,12 +57,27 @@ function smarty_modifiercompiler_escape($params, $compiler)
|
|||||||
. '), "HTML-ENTITIES", '
|
. '), "HTML-ENTITIES", '
|
||||||
. var_export($char_set, true) . ')';
|
. 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
|
// no MBString fallback
|
||||||
|
/* PrestaShop
|
||||||
return 'htmlentities('
|
return 'htmlentities('
|
||||||
. $params[0] .', ENT_QUOTES, '
|
. $params[0] .', ENT_QUOTES, '
|
||||||
. var_export($char_set, true) . ', '
|
. var_export($char_set, true) . ', '
|
||||||
. var_export($double_encode, true) . ')';
|
. var_export($double_encode, true) . ')';
|
||||||
|
*/
|
||||||
|
return 'htmlentities('
|
||||||
|
. $params[0] .', ENT_QUOTES, '
|
||||||
|
. var_export($char_set, true) . ')';
|
||||||
|
/* END */
|
||||||
|
|
||||||
case 'url':
|
case 'url':
|
||||||
return 'rawurlencode(' . $params[0] . ')';
|
return 'rawurlencode(' . $params[0] . ')';
|
||||||
|
|||||||
Reference in new issue
Block a user