Nucleus CMS日本語版SVNをgit-svnしたもの。リポジトリの変換作業用
Revision | 47eeac84a3570b0803869e5ea3a4dfa2c8e541eb (tree) |
---|---|
Zeit | 2009-03-17 05:59:41 |
Autor | kmorimatsu <kmorimatsu@1ca2...> |
Commiter | kmorimatsu |
$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
@@ -336,7 +336,7 @@ include($DIR_LANG . ereg_replace( '[\\|/]', '', $language) . '.php'); | ||
336 | 336 | |
337 | 337 | // check if valid charset |
338 | 338 | if (!encoding_check(false, false, _CHARSET)) { |
339 | - foreach(array($_REQUEST, $_SERVER) as $input) { | |
339 | + foreach(array($_GET, $_POST) as $input) { | |
340 | 340 | array_walk($input, 'encoding_check'); |
341 | 341 | } |
342 | 342 | } |
@@ -588,7 +588,7 @@ function sendContentType($contenttype, $pagetype = '', $charset = _CHARSET) { | ||
588 | 588 | |
589 | 589 | // check if valid charset |
590 | 590 | if (!encoding_check(false,false,$charset)) { |
591 | - foreach(array($_REQUEST, $_SERVER) as $input) { | |
591 | + foreach(array($_GET, $_POST) as $input) { | |
592 | 592 | array_walk($input, 'encoding_check'); |
593 | 593 | } |
594 | 594 | } |
@@ -1546,6 +1546,12 @@ function formatDate($format, $timestamp, $defaultFormat, &$blog) { | ||
1546 | 1546 | |
1547 | 1547 | function encoding_check($val, $key, $encoding=false, $exclude=false) { |
1548 | 1548 | /* |
1549 | + Set $CONF['DisableEncodingCheck']=1 only for special occasion, e.g. install script. | |
1550 | + Don't set this permanently in nucleus_config table. | |
1551 | + */ | |
1552 | + global $CONF; | |
1553 | + if (!empty($CONF['DisableEncodingCheck'])) return true; | |
1554 | + /* | |
1549 | 1555 | When 3rd argument is set, return if checked already. |
1550 | 1556 | When 4th argument is set, set the excluded key(s). |
1551 | 1557 | */ |