Skip to content

Commit

Permalink
Fixed rootPath
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed May 3, 2013
1 parent eaf16fa commit b4c024a
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 @@ -23,7 +23,7 @@ public function run()
{
// Determine the client-side path to root
if ( !empty($_SERVER['REQUEST_URI']) ) {
$this->rootPath = preg_replace('/(index\.php)?(\?.*)?$/', '', $_SERVER['REQUEST_URI']);
$this->rootPath = preg_replace('/(index\.php)?(\?.*)?$/', '', rawurldecode($_SERVER['REQUEST_URI']));
}

// Run from command line, e.g. "php index.php -q index"
Expand All @@ -34,7 +34,7 @@ public function run()
}

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

// Extract controller name, view name, action name and arguments from URL
Expand Down

0 comments on commit b4c024a

Please sign in to comment.