X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fredir.php;h=d928e66df0c99f910063c73aa5f4af5e24baa441;hb=1a86167ac589777b3fb5f8c6dcf7f4f302a3785f;hp=f38b6f7c3ccbe8a21b2325892894969d6c538630;hpb=b36fb80eb9310bec5c23df90d48a78314193ce4b;p=friendica.git diff --git a/mod/redir.php b/mod/redir.php index f38b6f7c3c..d928e66df0 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -125,13 +125,10 @@ function redir_init(App $a) { System::externalRedirect($contact['poll'] . '?dfrn_id=' . $dfrn_id . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet); - - redir_check_url($contact_url, $url); - $url = $url ?: $contact_url; } if (empty($url)) { - throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.')); + throw new \Friendica\Network\HTTPException\BadRequestException(DI::l10n()->t('Bad Request.')); } // If we don't have a connected contact, redirect with @@ -193,6 +190,10 @@ function redir_check_url(string $contact_url, string $url) } $url_host = parse_url($url, PHP_URL_HOST); + if (empty($url_host)) { + $url_host = parse_url(DI::baseUrl(), PHP_URL_HOST); + } + $contact_url_host = parse_url($contact_url, PHP_URL_HOST); if ($url_host == $contact_url_host) {