mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
Test for existence of htmlspecialchars flag (PHP < 5.4)
This commit is contained in:
@@ -101,8 +101,13 @@ function smarty_function_mailto($params)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$string = '<a href="mailto:' . htmlspecialchars($address, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, Smarty::$_CHARSET) .
|
$flags = ENT_QUOTES;
|
||||||
'" ' . $extra . '>' . htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, Smarty::$_CHARSET) . '</a>';
|
if (defined('ENT_SUBSTITUTE') && defined('ENT_HTML401')) {
|
||||||
|
$flags |= ENT_SUBSTITUTE | ENT_HTML401;
|
||||||
|
}
|
||||||
|
|
||||||
|
$string = '<a href="mailto:' . htmlspecialchars($address, $flags, Smarty::$_CHARSET) .
|
||||||
|
'" ' . $extra . '>' . htmlspecialchars($text, $flags, Smarty::$_CHARSET) . '</a>';
|
||||||
|
|
||||||
if ($encode === 'javascript') {
|
if ($encode === 'javascript') {
|
||||||
$js_encode = '';
|
$js_encode = '';
|
||||||
|
Reference in New Issue
Block a user