/** * Cleans the request from script injection. * * @static * @return void * @since 1.5 */ public static function clean() { SomeRequest::_cleanArray($_FILES); SomeRequest::_cleanArray($_ENV); SomeRequest::_cleanArray($_GET); SomeRequest::_cleanArray($_POST); SomeRequest::_cleanArray($_COOKIE); SomeRequest::_cleanArray($_SERVER); if (isset($_SESSION)) { SomeRequest::_cleanArray($_SESSION); } $REQUEST = $_REQUEST; $GET = $_GET; $POST = $_POST; $COOKIE = $_COOKIE; $FILES = $_FILES; $ENV = $_ENV; $SERVER = $_SERVER; if (isset($_SESSION)) { $SESSION = $_SESSION; } foreach ($GLOBALS as $key => $value) { if ($key != 'GLOBALS') { unset($GLOBALS[$key]); } } $_REQUEST = $REQUEST; $_GET = $GET; $_POST = $POST; $_COOKIE = $COOKIE; $_FILES = $FILES; $_ENV = $ENV; $_SERVER = $SERVER; if (isset($SESSION)) { $_SESSION = $SESSION; } // Make sure the request hash is clean on file inclusion $GLOBALS['_JREQUEST'] = array(); }