diff options
| author | 2023-04-07 16:12:03 +0200 | |
|---|---|---|
| committer | 2023-04-07 16:12:03 +0200 | |
| commit | b6ac505f8fa0012fa48d2442dd98cabdaf122269 (patch) | |
| tree | 76085b1e4a03c2b56f03f73f086fbc9bacd7919f /lib | |
| parent | dbbae15a8458679db0f4540dacdbdcff9c02ec8c (diff) | |
Fix login (#5271)
Fix https://github.com/FreshRSS/FreshRSS/issues/5270
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/Request.php | 6 | ||||
| -rw-r--r-- | lib/Minz/Url.php | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index c994c7b00..a03aff18b 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -374,12 +374,12 @@ class Minz_Request { /** * Relance une requête - * @param array{'c'?:string,'a'?:string,'params'?:array<string,mixed>} $url l'url vers laquelle est relancée la requête + * @param string|array{'c'?:string,'a'?:string,'params'?:array<string,mixed>} $url l'url vers laquelle est relancée la requête * @param bool $redirect si vrai, force la redirection http * > sinon, le dispatcher recharge en interne */ - public static function forward(array $url = [], bool $redirect = false): void { - if (empty(Minz_Request::originalRequest()) && strpos('auth', json_encode($url)) !== false) { + public static function forward($url = [], bool $redirect = false): void { + if (empty(Minz_Request::originalRequest())) { self::$originalRequest = $url; } diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php index 80745848a..1350973c1 100644 --- a/lib/Minz/Url.php +++ b/lib/Minz/Url.php @@ -127,8 +127,11 @@ class Minz_Url { return $url_checked; } - /** @param array<string,string|array<string,string>> $url */ - public static function serialize(array $url = []): string { + /** @param array<string,string|array<string,string>>|null $url */ + public static function serialize(?array $url = []): string { + if (empty($url)) { + return ''; + } try { return base64_encode(json_encode($url, JSON_THROW_ON_ERROR)); } catch (\Throwable $exception) { |
