OSDN Git Service

Smartyを3にバージョンアップ
[epgrec/epgrec.git] / Smarty / plugins / variablefilter.htmlspecialchars.php
diff --git a/Smarty/plugins/variablefilter.htmlspecialchars.php b/Smarty/plugins/variablefilter.htmlspecialchars.php
new file mode 100644 (file)
index 0000000..aff711e
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFilter
+ */
+
+/**
+ * Smarty htmlspecialchars variablefilter plugin
+ *
+ * @param string                   $source input string
+ * @param Smarty_Internal_Template $smarty Smarty object
+ * @return string filtered output
+ */
+function smarty_variablefilter_htmlspecialchars($source, $smarty)
+{
+    return htmlspecialchars($source, ENT_QUOTES, Smarty::$_CHARSET);
+}
+
+?>
\ No newline at end of file