// PukiWiki - Yet another WikiWikiWeb clone.
// func.php
// Copyright
-// 2002-2018 PukiWiki Development Team
+// 2002-2019 PukiWiki Development Team
// 2001-2002 Originally written by yu-ji
// License: GPL v2 or (at your option) any later version
//
}
/**
+ * Get JSON string with htmlspecialchars().
+ */
+function htmlsc_json($obj)
+{
+ // json_encode: PHP 5.2+
+ // JSON_UNESCAPED_UNICODE: PHP 5.4+
+ // JSON_UNESCAPED_SLASHES: PHP 5.4+
+ if (defined('JSON_UNESCAPED_UNICODE')) {
+ return htmlsc(json_encode($obj,
+ JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
+ }
+ return '';
+}
+
+/**
* Get redirect page name on Page Redirect Rules
*
* This function returns exactly false if it doesn't need redirection.