Skip to content

Commit

Permalink
Check for closure before class exists (#36293)
Browse files Browse the repository at this point in the history
* class_exists on a closure throws an exception in PHP8
  • Loading branch information
patrickomeara authored Feb 17, 2021
1 parent 73dd43d commit 34d58b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,13 @@ public function gatherRouteMiddleware(Route $route)
})->flatten()->reject(function ($name) use ($excluded) {
if (empty($excluded)) {
return false;
} elseif (in_array($name, $excluded, true)) {
}

if ($name instanceof Closure) {
return false;
}

if (in_array($name, $excluded, true)) {
return true;
}

Expand Down

0 comments on commit 34d58b5

Please sign in to comment.