Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stack filters

  • Loading branch information...
commit 25dde8eb84de80352b54b020810122a98802e7a9 1 parent 484a737
@codler authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 laravel/routing/filter.php
View
13 laravel/routing/filter.php
@@ -39,7 +39,18 @@ public static function register($name, Closure $callback)
{
if (isset(static::$aliases[$name])) $name = static::$aliases[$name];
- static::$filters[$name] = $callback;
+ if (isset(static::$filters[$name]))
+ {
+ $old = static::$filters[$name];
+ static::$filters[$name] = function() use ($old, $callback) {
+ call_user_func_array($callback, func_get_args());
+ call_user_func_array($old, func_get_args());
+ };
+ }
+ else
+ {
+ static::$filters[$name] = $callback;
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.