Skip to content

Commit

Permalink
Fix issue where overwriting middleware variable when setting middlewa…
Browse files Browse the repository at this point in the history
…re priority (laravel#53504)
  • Loading branch information
ollieread authored Nov 14, 2024
1 parent 86803dc commit 47e5f76
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,14 @@ public function withMiddleware(?callable $callback = null)
}

if ($priorityAppends = $middleware->getMiddlewarePriorityAppends()) {
foreach ($priorityAppends as $middleware => $after) {
$kernel->addToMiddlewarePriorityAfter($after, $middleware);
foreach ($priorityAppends as $newMiddleware => $after) {
$kernel->addToMiddlewarePriorityAfter($after, $newMiddleware);
}
}

if ($priorityPrepends = $middleware->getMiddlewarePriorityPrepends()) {
foreach ($priorityPrepends as $middleware => $before) {
$kernel->addToMiddlewarePriorityBefore($before, $middleware);
foreach ($priorityPrepends as $newMiddleware => $before) {
$kernel->addToMiddlewarePriorityBefore($before, $newMiddleware);
}
}
});
Expand Down

0 comments on commit 47e5f76

Please sign in to comment.