]> git.mxchange.org Git - friendica.git/commitdiff
Using internal redirect in case of missing scheme
authorMichael <heluecht@pirati.ca>
Mon, 1 Nov 2021 21:21:03 +0000 (21:21 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 1 Nov 2021 21:21:03 +0000 (21:21 +0000)
src/Core/System.php

index 15f4ba60aacd4e6d847b1d10f543489b3cd632e0..86e562f12318d0dd28bab0cf8eba865fcba324fe 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Core;
 
 use Friendica\DI;
-use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Network\HTTPException\FoundException;
 use Friendica\Network\HTTPException\MovedPermanentlyException;
 use Friendica\Network\HTTPException\TemporaryRedirectException;
@@ -229,13 +228,12 @@ class System
         *
         * @param string $url  The new Location to redirect
         * @param int    $code The redirection code, which is used (Default is 302)
-        *
-        * @throws BadRequestException If the URL is not fully qualified
         */
        public static function externalRedirect($url, $code = 302)
        {
                if (empty(parse_url($url, PHP_URL_SCHEME))) {
-                       throw new BadRequestException("'$url' is not a fully qualified URL, please use App->internalRedirect() instead");
+                       Logger::warning('No fully qualified URL provided', ['url' => $url, 'callstack' => self::callstack(20)]);
+                       DI::baseUrl()->redirect($url);
                }
 
                header("Location: $url");