Skip to content

Commit a838fba

Browse files
committed
fix: Config $redirect = false does not work
1 parent f801829 commit a838fba

File tree

2 files changed

+6
-54
lines changed

2 files changed

+6
-54
lines changed

phpstan-baseline.neon.dist

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -741,63 +741,13 @@ parameters:
741741
path: system/Router/Router.php
742742

743743
-
744-
message: "#^Property Config\\\\App\\:\\:\\$CSRFCookieName \\(string\\) on left side of \\?\\? is not nullable\\.$#"
745-
count: 1
746-
path: system/Security/Security.php
747-
748-
-
749-
message: "#^Property Config\\\\App\\:\\:\\$CSRFExpire \\(int\\) on left side of \\?\\? is not nullable\\.$#"
750-
count: 1
751-
path: system/Security/Security.php
752-
753-
-
754-
message: "#^Property Config\\\\App\\:\\:\\$CSRFHeaderName \\(string\\) on left side of \\?\\? is not nullable\\.$#"
755-
count: 1
756-
path: system/Security/Security.php
757-
758-
-
759-
message: "#^Property Config\\\\App\\:\\:\\$CSRFRegenerate \\(bool\\) on left side of \\?\\? is not nullable\\.$#"
760-
count: 1
761-
path: system/Security/Security.php
762-
763-
-
764-
message: "#^Property Config\\\\App\\:\\:\\$CSRFTokenName \\(string\\) on left side of \\?\\? is not nullable\\.$#"
765-
count: 1
766-
path: system/Security/Security.php
767-
768-
-
769-
message: "#^Property Config\\\\Security\\:\\:\\$cookieName \\(string\\) on left side of \\?\\? is not nullable\\.$#"
770-
count: 1
744+
message: "#^Property Config\\\\App\\:\\:\\$CSRF[a-zA-Z]+ \\([a-zA-Z]+\\) on left side of \\?\\? is not nullable\\.$#"
745+
count: 6
771746
path: system/Security/Security.php
772747

773748
-
774-
message: "#^Property Config\\\\Security\\:\\:\\$csrfProtection \\(string\\) on left side of \\?\\? is not nullable\\.$#"
775-
count: 1
776-
path: system/Security/Security.php
777-
778-
-
779-
message: "#^Property Config\\\\Security\\:\\:\\$expires \\(int\\) on left side of \\?\\? is not nullable\\.$#"
780-
count: 1
781-
path: system/Security/Security.php
782-
783-
-
784-
message: "#^Property Config\\\\Security\\:\\:\\$headerName \\(string\\) on left side of \\?\\? is not nullable\\.$#"
785-
count: 1
786-
path: system/Security/Security.php
787-
788-
-
789-
message: "#^Property Config\\\\Security\\:\\:\\$regenerate \\(bool\\) on left side of \\?\\? is not nullable\\.$#"
790-
count: 1
791-
path: system/Security/Security.php
792-
793-
-
794-
message: "#^Property Config\\\\Security\\:\\:\\$tokenName \\(string\\) on left side of \\?\\? is not nullable\\.$#"
795-
count: 1
796-
path: system/Security/Security.php
797-
798-
-
799-
message: "#^Property Config\\\\Security\\:\\:\\$tokenRandomize \\(bool\\) on left side of \\?\\? is not nullable\\.$#"
800-
count: 1
749+
message: "#^Property Config\\\\Security\\:\\:\\$[a-zA-Z]+ \\([a-zA-Z]+\\) on left side of \\?\\? is not nullable\\.$#"
750+
count: 8
801751
path: system/Security/Security.php
802752

803753
-

system/Security/Security.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public function __construct(App $config)
169169
$this->tokenName = $security->tokenName ?? $this->tokenName;
170170
$this->headerName = $security->headerName ?? $this->headerName;
171171
$this->regenerate = $security->regenerate ?? $this->regenerate;
172+
$this->redirect = $security->redirect ?? $this->redirect;
172173
$this->rawCookieName = $security->cookieName ?? $this->rawCookieName;
173174
$this->expires = $security->expires ?? $this->expires;
174175
$this->tokenRandomize = $security->tokenRandomize ?? $this->tokenRandomize;
@@ -179,6 +180,7 @@ public function __construct(App $config)
179180
$this->regenerate = $config->CSRFRegenerate ?? $this->regenerate;
180181
$this->rawCookieName = $config->CSRFCookieName ?? $this->rawCookieName;
181182
$this->expires = $config->CSRFExpire ?? $this->expires;
183+
$this->redirect = $config->CSRFRedirect ?? $this->redirect;
182184
}
183185

184186
if ($this->isCSRFCookie()) {

0 commit comments

Comments
 (0)