From 40dfb1fccf8c299d8740e77097dfbbfdcfefb594 Mon Sep 17 00:00:00 2001 From: IanM Date: Fri, 5 Jan 2024 09:04:26 +0000 Subject: [PATCH] resolve ternary always true --- framework/core/src/Forum/Controller/LogOutController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/core/src/Forum/Controller/LogOutController.php b/framework/core/src/Forum/Controller/LogOutController.php index 5860c9b0cc..1c88417f56 100644 --- a/framework/core/src/Forum/Controller/LogOutController.php +++ b/framework/core/src/Forum/Controller/LogOutController.php @@ -93,8 +93,8 @@ public function handle(Request $request): ResponseInterface $actor = RequestUtil::getActor($request); $base = $this->url->to('forum')->base(); - $rurl = (string) Arr::get($request->getQueryParams(), 'return'); - $return = $this->sanitizeReturnUrl($rurl, $base); + $rurl = Arr::get($request->getQueryParams(), 'return'); + $return = $this->sanitizeReturnUrl((string) $rurl, $base); // If there is no user logged in, return to the index or the return url if it's set. if ($actor->isGuest()) { @@ -107,7 +107,7 @@ public function handle(Request $request): ResponseInterface if (Arr::get($request->getQueryParams(), 'token') !== $csrfToken) { $view = $this->view->make('flarum.forum::log-out') - ->with('url', $this->url->to('forum')->route('logout') . '?token=' . $csrfToken . ($return ? '&return=' . urlencode($return) : '')); + ->with('url', $this->url->to('forum')->route('logout') . '?token=' . $csrfToken . ($rurl ? '&return=' . urlencode($return) : '')); return new HtmlResponse($view->render()); }