aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2015-02-26 11:28:50 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2015-02-26 11:28:50 +0100
commit9eaf82dfa1e320a344944f2789662dc0965c4e6f (patch)
tree0303b11cada50b778bc2afdc3f24e4d39ccf110b
parent67544b4ba2366125955f3d8727a774f4f26d7746 (diff)
downloadRouter-9eaf82dfa1e320a344944f2789662dc0965c4e6f.zip
Router-9eaf82dfa1e320a344944f2789662dc0965c4e6f.tar.gz
Router-9eaf82dfa1e320a344944f2789662dc0965c4e6f.tar.bz2
Decode URI after having splitted subdomain & URI.
We can use `@` to specify a subdomain and a URI (for instance `sub@/uri/`) in the same `$uri`. Previously, we decoded URI before splitting the subdomain and the URI. Consequently, if a URI contains `%40`, being `@`, everything at the left of `%40` will be considered as a subdomain, and therefore, it is highly likely to fail the routing. Now we decode URI after having splitted the subdomain and the URI.
-rw-r--r--Http/Http.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/Http/Http.php b/Http/Http.php
index 30ae046..c46ef86 100644
--- a/Http/Http.php
+++ b/Http/Http.php
@@ -271,14 +271,12 @@ class Http extends Router\Generic implements Core\Parameter\Parameterizable {
}
else {
- $uri = urldecode($uri);
-
if(false !== $pos = strpos($uri, '@'))
list($subdomain, $uri) = explode('@', $uri, 2);
else
$subdomain = $this->getSubdomain();
- $uri = ltrim($uri, '/');
+ $uri = ltrim(urldecode($uri), '/');
}
if(null === $prefix)