moved escape filter to core runtime (closes #4)
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 12 Oct 2009 05:38:32 +0000 (05:38 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 12 Oct 2009 05:38:32 +0000 (05:38 +0000)
git-svn-id: http://svn.twig-project.org/trunk@21 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/runtime.php
lib/Twig/runtime_escaper.php

index 0b5dd24..d4b02c1 100644 (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'))
 {
index b62badd..1a40d48 100644 (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());
-}