Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
ea8c6e18
Commit
ea8c6e18
authored
Jan 19, 2012
by
Eric Barnes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed route handles for uri's that partially match
parent
9bcbe6a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
route.php
laravel/routing/route.php
+2
-2
route.test.php
tests/cases/laravel/route.test.php
+1
-0
No files found.
laravel/routing/route.php
View file @
ea8c6e18
...
...
@@ -118,7 +118,7 @@ class Route {
*/
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
// its response. This is the most basic form of route, and is
// the simplest to handle.
...
...
@@ -214,7 +214,7 @@ class Route {
*/
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
)
{
...
...
tests/cases/laravel/route.test.php
View file @
ea8c6e18
...
...
@@ -24,6 +24,7 @@ class RouteTest extends PHPUnit_Framework_TestCase {
$this
->
assertFalse
(
$route
->
handles
(
'/'
));
$this
->
assertFalse
(
$route
->
handles
(
'baz'
));
$this
->
assertFalse
(
$route
->
handles
(
'/foo'
));
$this
->
assertFalse
(
$route
->
handles
(
'foo'
));
$route
=
new
Laravel\Routing\Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /'
,
'GET /home'
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment