From: kmorimatsu Date: Mon, 16 Mar 2009 20:59:41 +0000 (+0000) Subject: $CONF['DisableEncodingCheck'] for encoding_check function. X-Git-Tag: release-3-41@1002~15 X-Git-Url: http://git.osdn.net/view?p=nucleus-jp%2Fnucleus-jp-ancient.git;a=commitdiff_plain;h=47eeac84a3570b0803869e5ea3a4dfa2c8e541eb $CONF['DisableEncodingCheck'] for encoding_check function. Only check $_GET and $_POST by encoding_check() to avoid problem using special characters in $_SERVER and $_COOKIE. git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk/utf8@977 1ca29b6e-896d-4ea0-84a5-967f57386b96 --- diff --git a/nucleus/libs/globalfunctions.php b/nucleus/libs/globalfunctions.php index 71c2a05..1c109c2 100755 --- a/nucleus/libs/globalfunctions.php +++ b/nucleus/libs/globalfunctions.php @@ -336,7 +336,7 @@ include($DIR_LANG . ereg_replace( '[\\|/]', '', $language) . '.php'); // check if valid charset if (!encoding_check(false, false, _CHARSET)) { - foreach(array($_REQUEST, $_SERVER) as $input) { + foreach(array($_GET, $_POST) as $input) { array_walk($input, 'encoding_check'); } } @@ -588,7 +588,7 @@ function sendContentType($contenttype, $pagetype = '', $charset = _CHARSET) { // check if valid charset if (!encoding_check(false,false,$charset)) { - foreach(array($_REQUEST, $_SERVER) as $input) { + foreach(array($_GET, $_POST) as $input) { array_walk($input, 'encoding_check'); } } @@ -1546,6 +1546,12 @@ function formatDate($format, $timestamp, $defaultFormat, &$blog) { function encoding_check($val, $key, $encoding=false, $exclude=false) { /* + Set $CONF['DisableEncodingCheck']=1 only for special occasion, e.g. install script. + Don't set this permanently in nucleus_config table. + */ + global $CONF; + if (!empty($CONF['DisableEncodingCheck'])) return true; + /* When 3rd argument is set, return if checked already. When 4th argument is set, set the excluded key(s). */