mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 03:46:39 +00:00
moved escape filter to core runtime (closes #4)
git-svn-id: http://svn.twig-project.org/trunk@21 93ef8e89-cb99-4229-a87c-7fa0fa45744b
This commit is contained in:
@@ -99,6 +99,16 @@ function twig_sort_filter($array)
|
||||
return $array;
|
||||
}
|
||||
|
||||
function twig_escape_filter(Twig_TemplateInterface $template, $string)
|
||||
{
|
||||
if (!is_string($string))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
|
||||
return htmlspecialchars($string, ENT_QUOTES, $template->getEnvironment()->getCharset());
|
||||
}
|
||||
|
||||
// add multibyte extensions if possible
|
||||
if (function_exists('mb_get_info'))
|
||||
{
|
||||
|
||||
@@ -14,13 +14,3 @@ function twig_safe_filter($string)
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
|
||||
function twig_escape_filter(Twig_TemplateInterface $template, $string)
|
||||
{
|
||||
if (!is_string($string))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
|
||||
return htmlspecialchars($string, ENT_QUOTES, $template->getEnvironment()->getCharset());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user