From c6616a917a1b9d651816a4708bac2eb9c80c96f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=CC=88nther=20Debrauwer?= Date: Tue, 19 Mar 2024 12:05:32 +0100 Subject: [PATCH 1/2] Remove $except from trait --- .../Foundation/Http/Middleware/Concerns/ExcludesPaths.php | 7 ------- .../Http/Middleware/PreventRequestsDuringMaintenance.php | 7 +++++++ .../Foundation/Http/Middleware/VerifyCsrfToken.php | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php b/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php index 622d9dd0b5da..4ceaed5c0512 100644 --- a/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php +++ b/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php @@ -4,13 +4,6 @@ trait ExcludesPaths { - /** - * The URIs that should be excluded. - * - * @var array - */ - protected $except = []; - /** * Determine if the request has a URI that should be excluded. * diff --git a/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php b/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php index 0ecfa38598e5..6adb87d01161 100644 --- a/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php +++ b/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -21,6 +21,13 @@ class PreventRequestsDuringMaintenance */ protected $app; + /** + * The URIs that should be excluded. + * + * @var array + */ + protected $except = []; + /** * The URIs that should be accessible during maintenance. * diff --git a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php index ba2f67e6af11..5edc53d38f57 100644 --- a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php +++ b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php @@ -34,6 +34,13 @@ class VerifyCsrfToken */ protected $encrypter; + /** + * The URIs that should be excluded. + * + * @var array + */ + protected $except = []; + /** * The globally ignored URIs that should be excluded from CSRF verification. * From 663953026aa2342c09c9f8a58959853d95a566c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=CC=88nther=20Debrauwer?= Date: Tue, 19 Mar 2024 13:29:02 +0100 Subject: [PATCH 2/2] Update getExcludedPaths method --- .../Foundation/Http/Middleware/Concerns/ExcludesPaths.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php b/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php index 4ceaed5c0512..941b2fec5cf9 100644 --- a/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php +++ b/src/Illuminate/Foundation/Http/Middleware/Concerns/ExcludesPaths.php @@ -32,6 +32,6 @@ protected function inExceptArray($request) */ public function getExcludedPaths() { - return $this->except; + return $this->except ?? []; } }