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
e4bc62da
Commit
e4bc62da
authored
Aug 11, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in route loader causing requests for specific formats to not be returned correctly.
parent
3ba30892
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
loader.php
system/routing/loader.php
+10
-0
No files found.
system/routing/loader.php
View file @
e4bc62da
...
@@ -50,6 +50,16 @@ class Loader {
...
@@ -50,6 +50,16 @@ class Loader {
*/
*/
private
function
load_nested_routes
(
$segments
)
private
function
load_nested_routes
(
$segments
)
{
{
// If the request URI only more than one segment, and the last segment contains a dot, we will
// assume the request is for a specific format (users.json or users.xml) and strip off
// everything after the dot so we can load the appropriate file.
if
(
count
(
$segments
)
>
0
and
strpos
(
end
(
$segments
),
'.'
)
!==
false
)
{
$segment
=
array_pop
(
$segments
);
array_push
(
$segments
,
substr
(
$segment
,
0
,
strpos
(
$segment
,
'.'
)));
}
// Work backwards through the URI segments until we find the deepest possible
// Work backwards through the URI segments until we find the deepest possible
// matching route directory. Once we find it, we will return those routes.
// matching route directory. Once we find it, we will return those routes.
foreach
(
array_reverse
(
$segments
,
true
)
as
$key
=>
$value
)
foreach
(
array_reverse
(
$segments
,
true
)
as
$key
=>
$value
)
...
...
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