codes****@googl*****
codes****@googl*****
2009年 3月 6日 (金) 22:33:03 JST
Author: mystralkk Date: Fri Mar 6 05:32:35 2009 New Revision: 1232 Modified: trunk/geeklog-1-jp/system/custom/custom_cellular.php Log: magic_quotes_gpcがオンの時に起こりうるバグに対処しました。 Modified: trunk/geeklog-1-jp/system/custom/custom_cellular.php ============================================================================== --- trunk/geeklog-1-jp/system/custom/custom_cellular.php (original) +++ trunk/geeklog-1-jp/system/custom/custom_cellular.php Fri Mar 6 05:32:35 2009 @@ -521,6 +521,15 @@ return $ret; } +// stripslashes(配列対応版) +function _mobile_stripslashes_deep($data) { + if (is_array($data)) { + return array_map('_mobile_stripslashes_deep', $data); + } else { + return stripslashes($data); + } +} + // urldecode(配列対応版) function _mobile_urldecode_deep($data) { if (is_array($data)) { @@ -536,8 +545,8 @@ $copy = $array; while (list($key, $val) = each($copy)) { if (get_magic_quotes_gpc()) { - $key = stripslashes($key); - $val = stripslashes($val); + $key = _mobile_stripslashes_deep($key); + $val = _mobile_stripslashes_deep($val); } $keyconv = urldecode($key); if( $key != $keyconv ) {