Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite of middleware sorting returns duplicates #16027

Closed
SuperlativeEntity opened this issue Oct 20, 2016 · 2 comments
Closed

Rewrite of middleware sorting returns duplicates #16027

SuperlativeEntity opened this issue Oct 20, 2016 · 2 comments

Comments

@SuperlativeEntity
Copy link

SuperlativeEntity commented Oct 20, 2016

  • Laravel Version: 5.3.19
  • PHP Version: PHP 5.6.25 (cli) (built: Aug 18 2016 11:40:20)
  • Database Driver & Version: Server version: 10.1.9-MariaDB-log mariadb.org binary distribution

Description:

framework/src/Illuminate/Routing/Router.php - function sortMiddleware returns an array with duplicates

Steps To Reproduce:

Debug or log output of function

Laravel Version: 5.3.18
sortMiddleware {"sorted":[
"Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse",
"Illuminate\Session\Middleware\StartSession",
"Illuminate\View\Middleware\ShareErrorsFromSession",
"App\Http\Middleware\VerifyCsrfToken",
"App\Http\Middleware\FilterIfPjax",
"App\Http\Middleware\ForceHttps",
"App\Http\Middleware\JSONRequest"]}

Laravel Version: 5.3.19
[2016-10-20 20:17:48] local.INFO: sortMiddleware {"wtf":[
"Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse",
"Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse",
"Illuminate\Session\Middleware\StartSession",
"Illuminate\Session\Middleware\StartSession",
"Illuminate\View\Middleware\ShareErrorsFromSession",
"App\Http\Middleware\VerifyCsrfToken",
"App\Http\Middleware\FilterIfPjax",
"App\Http\Middleware\ForceHttps",
"App\Http\Middleware\JSONRequest",
"Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse",
"Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse",
"Illuminate\View\Middleware\ShareErrorsFromSession",
"App\Http\Middleware\VerifyCsrfToken",
"App\Http\Middleware\FilterIfPjax",
"App\Http\Middleware\ForceHttps",
"App\Http\Middleware\JSONRequest",
"App\Http\Middleware\SentinelCheck",
"App\Http\Middleware\SentinelHasAccess",
"App\Http\Middleware\SessionExpired",
"App\Http\Middleware\UserActivity",
"App\Http\Middleware\JSONRequest"]}

@SuperlativeEntity SuperlativeEntity changed the title Pjax no longer working after rewrite of middleware sorting Rewrite of middleware sorting returns duplicates Oct 20, 2016
@SuperlativeEntity
Copy link
Author

Fix: return array_unique((new SortedMiddleware($this->middlewarePriority, $middlewares))->all());

@themsaid
Copy link
Member

Fixed in the PR linked with the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants