From: Hypolite Petovan Date: Thu, 8 Dec 2022 03:24:01 +0000 (-0500) Subject: Ensure strpos is provided a string in App::runFrontend X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f3dc69c226ea15f5ea5b1f1b470ee74c27313ef7;p=friendica.git Ensure strpos is provided a string in App::runFrontend - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783 --- diff --git a/src/App.php b/src/App.php index 25770dd782..0d4e8880dd 100644 --- a/src/App.php +++ b/src/App.php @@ -631,10 +631,10 @@ class App // ZRL if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !$this->session->getLocalUserId()) { - // Only continue when the given profile link seems valid + // Only continue when the given profile link seems valid. // Valid profile links contain a path with "/profile/" and no query parameters if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') && - strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) { + strpos(parse_url($_GET['zrl'], PHP_URL_PATH) ?? '', '/profile/') !== false) { if ($this->session->get('visitor_home') != $_GET['zrl']) { $this->session->set('my_url', $_GET['zrl']); $this->session->set('authenticated', 0);