2) { l::notice("Invalid path requested: '$p'"); l::debug("Referer was '{$_SERVER['HTTP_REFERER']}'"); input::$path = 'main'; input::$page = 'notfound'; input::$eType = null; input::$game = config::getGame('main'); } else { if (count($tmp) == 1) { input::$path = 'main'; } else { input::$path = array_shift($tmp); } input::$page = $tmp[0]; } } // Find the game instance for this game if (!config::hasGame(input::$path)) { l::notice("Requested path '" . input::$path . "' doesn't match any game"); l::debug("Referer was '{$_SERVER['HTTP_REFERER']}' ; requested page was '" . input::$page . "'"); input::$path = 'main'; input::$page = 'notfound'; input::$eType = null; input::$game = config::getGame('main'); } else { input::$game = config::getGame(input::$path); } l::setPrefix(input::$path . "/" . input::$page . (is_null(input::$eType) ? "" : ( "." . input::$eType))); return array(input::$path, input::$page, input::$eType); } /** This function reads the arguments in the $_POST variable, then in the $_GET * variable, and stores them inside an hash table. If PHP's crappy "magic * quotes" are enabled, remove them. * NOTE: This behaviour should be reversed in a production version. */ static function read() { input::$IE = preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && !preg_match('/Opera/', $_SERVER['HTTP_USER_AGENT']); input::$safari = preg_match('/AppleWebKit/', $_SERVER['HTTP_USER_AGENT']); $p = array(); foreach ($_POST as $k => $v) { $p[$k] = $v; } foreach ($_GET as $k => $v) { $p[$k] = $v; } input::$input = $p; return $p; } } ?>