From a363d8d57498f640d72661d610a3cd78f72e7a04 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 17 Sep 2021 20:51:18 +0000 Subject: [PATCH] Fixed cookie getting lost (attempt). --- src/Http/Handlers/SockChatHandler.php | 2 +- src/url.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Http/Handlers/SockChatHandler.php b/src/Http/Handlers/SockChatHandler.php index 6533957e..d2c9c969 100644 --- a/src/Http/Handlers/SockChatHandler.php +++ b/src/Http/Handlers/SockChatHandler.php @@ -277,7 +277,7 @@ final class SockChatHandler extends Handler { $response->redirect( $currentUser === null - ? url('auth-login', ['redirect' => $chatPath]) + ? url('auth-login', ['redirect' => '/_sockchat/login']) : $chatPath ); } diff --git a/src/url.php b/src/url.php index 80bd4db7..8dca95d2 100644 --- a/src/url.php +++ b/src/url.php @@ -271,8 +271,5 @@ function is_local_url(string $url): bool { if($url[0] === '/' && ($length > 1 ? $url[1] !== '/' : true)) return true; - if(starts_with($url, url_prefix())) - return true; - - return ends_with(parse_url($url, PHP_URL_HOST), '.' . $_SERVER['HTTP_HOST']); + return starts_with($url, url_prefix()); }