/** * Set the $post and $get variables, since they will * be set to the same properties in the CodonModule class * */ public static function setParameters() { self::$post = new stdClass(); self::$get = new stdClass(); foreach ($_POST as $key => $value) { self::$post->{$key} = self::cleaned($value); } foreach ($_GET as $key => $value) { self::$get->{$key} = self::cleaned($value); } foreach ($_REQUEST as $key => $value) { self::$request->{$key} = self::cleaned($value); } }
/** * 本体実行前にクラスを初期化する。 */ static function init() { //GET、POST、COOKIEの初期化 self::$post = $_POST; self::$get = $_GET; self::$cookie = $_COOKIE; if (get_magic_quotes_gpc()) { self::$post = map('stripslashes', self::$post); self::$get = map('stripslashes', self::$get); self::$cookie = map('stripslashes', self::$cookie); } self::$get = map('rawurldecode', self::$get); if (ini_get('mbstring.encoding_translation')) { $encode = ini_get('mbstring.internal_encoding'); $proc = "return mb_convert_encoding(\$str, 'UTF-8', '{$encode}');"; self::$post = map(create_function('$str', $proc), self::$post); } }