Skip to content

Commit

Permalink
fix #14367 by removing double URL encoding (#14370)
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored and taylorotwell committed Jul 19, 2016
1 parent d059f90 commit 153af5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/Illuminate/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,7 @@ public function forgetParameter($name)
public function parameters()
{
if (isset($this->parameters)) {
return array_map(function ($value) {
return is_string($value) ? rawurldecode($value) : $value;
}, $this->parameters);
return $this->parameters;
}

throw new LogicException('Route is not bound.');
Expand Down
6 changes: 6 additions & 0 deletions tests/Routing/RoutingRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ public function testBasicDispatchingOfRoutes()
$this->assertTrue($router->is('foo'));
$this->assertFalse($router->is('bar'));

$router = $this->getRouter();
$route = $router->get('foo/{file}', function ($file) {
return $file;
});
$this->assertEquals('oxygen%20', $router->dispatch(Request::create('http://test.com/foo/oxygen%2520', 'GET'))->getContent());

$router = $this->getRouter();
$router->patch('foo/bar', ['as' => 'foo', function () {
return 'bar';
Expand Down

0 comments on commit 153af5c

Please sign in to comment.