Skip to content

Commit

Permalink
Fix issue in resetting QUERY_STRING, GET vars introduced in f2b19fe
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Oct 31, 2012
1 parent 9dd2dbb commit ea6688b
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions system/core/URI.php
Expand Up @@ -212,7 +212,7 @@ protected function _parse_request_uri()
$_SERVER['QUERY_STRING'] = $query;
}

$this->_reset_query_string();
parse_str($_SERVER['QUERY_STRING'], $_GET);

if ($uri === '/' OR $uri === '')
{
Expand Down Expand Up @@ -248,37 +248,13 @@ protected function _parse_query_string()
$uri = rawurldecode($uri[0]);
}

$this->_reset_query_string();
parse_str($_SERVER['QUERY_STRING'], $_GET);

return str_replace(array('//', '../'), '/', trim($uri, '/'));
}

// --------------------------------------------------------------------

/**
* Reset QUERY_STRING
*
* Re-processes QUERY_STRING to and fetches the real GET values from it.
* Useful for cases where we got the URI path from it's query string.
*
* @used-by CI_URI::_parse_request_uri()
* @used-by CI_URI::_parse_query_string()
* @return void
*/
protected function _reset_query_string()
{
if ($_SERVER['QUERY_STRING'] === '')
{
$_GET = array();
}
else
{
parse_str($_SERVER['QUERY_STRING']);
}
}

// --------------------------------------------------------------------

/**
* Is CLI Request?
*
Expand Down

0 comments on commit ea6688b

Please sign in to comment.