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
1c97dcca
Commit
1c97dcca
authored
Dec 04, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix filter parameter merging bug and update changelog.
parent
4c3ffcef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
changelog.md
changelog.md
+1
-0
filter.php
laravel/routing/filter.php
+7
-3
No files found.
changelog.md
View file @
1c97dcca
...
...
@@ -5,6 +5,7 @@
-
Feature: Added default parameter to File::get method.
-
Feature: Allow for message container to be passed to Redirect's "with_errors" method.
-
Fix: Lowercase HTTP verbs may be passed to Form::open method.
-
Fix: Filter parameters are now merged correctly.
### Upgrading from 2.0.3
...
...
laravel/routing/filter.php
View file @
1c97dcca
...
...
@@ -26,27 +26,31 @@ class Filter {
* Call a filter or set of filters.
*
* @param array|string $filters
* @param array $pa
rameter
s
* @param array $pa
s
s
* @param bool $override
* @return mixed
*/
public
static
function
run
(
$filters
,
$pa
rameter
s
=
array
(),
$override
=
false
)
public
static
function
run
(
$filters
,
$pa
s
s
=
array
(),
$override
=
false
)
{
foreach
(
static
::
parse
(
$filters
)
as
$filter
)
{
$parameters
=
array
();
// Parameters may be passed into routes by specifying the list of
// parameters after a colon. If parameters are present, we will
// merge them into the parameter array that was passed to the
// method and slice the parameters off of the filter string.
if
((
$colon
=
strpos
(
$filter
,
':'
))
!==
false
)
{
$parameters
=
array_merge
(
$parameters
,
explode
(
','
,
substr
(
$filter
,
$colon
+
1
)
));
$parameters
=
explode
(
','
,
substr
(
$filter
,
$colon
+
1
));
$filter
=
substr
(
$filter
,
0
,
$colon
);
}
if
(
!
isset
(
static
::
$filters
[
$filter
]))
continue
;
$parameters
=
array_merge
(
$pass
,
$parameters
);
$response
=
call_user_func_array
(
static
::
$filters
[
$filter
],
$parameters
);
// "Before" filters may override the request cycle. For example,
...
...
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