Commit 1c97dcca authored by Taylor Otwell's avatar Taylor Otwell

fix filter parameter merging bug and update changelog.

parent 4c3ffcef
......@@ -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
......
......@@ -26,27 +26,31 @@ class Filter {
* Call a filter or set of filters.
*
* @param array|string $filters
* @param array $parameters
* @param array $pass
* @param bool $override
* @return mixed
*/
public static function run($filters, $parameters = array(), $override = false)
public static function run($filters, $pass = 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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment