Skip to content

Commit

Permalink
URL encode query string when parsing root path
Browse files Browse the repository at this point in the history
  • Loading branch information
AliasIO committed Mar 3, 2013
1 parent a42d6f6 commit 74cabf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Swiftlet/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function run()
$this->rootPath = preg_replace('/(index\.php)?(\?.*)?$/', '', $_SERVER['REQUEST_URI']);

if ( !empty($_GET['q']) ) {
$this->rootPath = preg_replace('/' . preg_quote($_GET['q'], '/') . '$/', '', $this->rootPath);
$this->rootPath = preg_replace('/' . preg_quote(rawurlencode($_GET['q']), '/') . '$/', '', $this->rootPath);
}
}

Expand Down Expand Up @@ -126,7 +126,7 @@ public function getConfig($variable)
/**
* Set a configuration value
* @param string $variable
* @param mixed $value
* @param mixed
*/
public function setConfig($variable, $value)
{
Expand Down

0 comments on commit 74cabf3

Please sign in to comment.