better GET params handling when the server is badly configured and missing the globel params

This commit is contained in:
krasi georgiev 2016-10-30 18:25:10 +00:00
parent bdd90a680d
commit bad5a1c3f2
2 changed files with 12 additions and 6 deletions

View File

@ -20,7 +20,13 @@ class Url
$explode = explode('?', $decode);
$this->uri = $explode[0];
$this->parameters = $_GET;
// deal with server config when missing the get params
if(empty($_GET)){
isset($explode[1]) ? parse_str($explode[1], $this->parameters):"";
}
else{
$this->parameters=$_GET;
}
$this->uriStrlen = Text::length($this->uri);