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:
fabien
2009-10-12 05:38:32 +00:00
parent 561dea5f8a
commit 34cf7dfe99
2 changed files with 10 additions and 10 deletions
+10
View File
@@ -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'))
{
-10
View File
@@ -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());
}