Merge pull request #246 from ericbarnes/develop
Bug fix for route::handles
This commit is contained in:
commit
e6cec8c54b
|
@ -118,7 +118,7 @@ public function call()
|
||||||
*/
|
*/
|
||||||
public function response()
|
public function response()
|
||||||
{
|
{
|
||||||
// If the action is a string, it is simply pointing the route to a
|
// If the action is a string, it is simply pointing the route to a
|
||||||
// controller action, and we can just call the action and return
|
// controller action, and we can just call the action and return
|
||||||
// its response. This is the most basic form of route, and is
|
// its response. This is the most basic form of route, and is
|
||||||
// the simplest to handle.
|
// the simplest to handle.
|
||||||
|
@ -214,7 +214,7 @@ public function is($name)
|
||||||
*/
|
*/
|
||||||
public function handles($uri)
|
public function handles($uri)
|
||||||
{
|
{
|
||||||
$pattern = ($uri !== '/') ? str_replace('*', '(.*)', $uri) : '^/$';
|
$pattern = ($uri !== '/') ? str_replace('*', '(.*)', $uri).'\z' : '^/$';
|
||||||
|
|
||||||
return ! is_null(array_first($this->uris, function($key, $uri) use ($pattern)
|
return ! is_null(array_first($this->uris, function($key, $uri) use ($pattern)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,7 @@ public function testHandlesIndicatesIfTheRouteHandlesAGivenURI()
|
||||||
$this->assertFalse($route->handles('/'));
|
$this->assertFalse($route->handles('/'));
|
||||||
$this->assertFalse($route->handles('baz'));
|
$this->assertFalse($route->handles('baz'));
|
||||||
$this->assertFalse($route->handles('/foo'));
|
$this->assertFalse($route->handles('/foo'));
|
||||||
|
$this->assertFalse($route->handles('foo'));
|
||||||
|
|
||||||
$route = new Laravel\Routing\Route('GET /', array('handles' => array('GET /', 'GET /home')));
|
$route = new Laravel\Routing\Route('GET /', array('handles' => array('GET /', 'GET /home')));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue