OSDN Git Service

Functions to functions
[pukiwiki/pukiwiki_sandbox.git] / spam / spam_util.php
index 217726a..22ae474 100644 (file)
@@ -1,6 +1,6 @@
 <?php
-// $Id: spam_util.php,v 1.1 2009/01/02 10:44:53 henoheno Exp $
-// Copyright (C) 2006-2007 PukiWiki Developers Team
+// $Id: spam_util.php,v 1.5 2011/01/25 13:16:35 henoheno Exp $
+// Copyright (C) 2006-2009, 2011 PukiWiki Developers Team
 // License: GPL v2 or (at your option) any later version
 //
 // Functions for Concept-work of spam-uri metrics
@@ -38,6 +38,18 @@ function preg_grep_invert($pattern = '//', $input = array())
 // ---------------------
 // Utilities
 
+
+if (! function_exists('htmlsc')) {
+       // Interface with PukiWiki
+       //if (! defined('CONTENT_CHARSET')) define('CONTENT_CHARSET', 'ISO-8859-1');
+
+       // Sugar with default settings
+       function htmlsc($string = '', $flags = ENT_QUOTES, $charset = CONTENT_CHARSET)
+       {
+               return htmlspecialchars($string, $flags, $charset);     // htmlsc()
+       }
+}
+
 // Very roughly, shrink the lines of var_export()
 // NOTE: If the same data exists, it must be corrupted.
 function var_export_shrink($expression, $return = FALSE, $ignore_numeric_keys = FALSE)