]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6005 from nupplaphil/friendica-5996
authorrabuzarus <rabuzarus@t-online.de>
Tue, 23 Oct 2018 10:26:28 +0000 (12:26 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Oct 2018 10:26:28 +0000 (12:26 +0200)
Fixing absolute/relative path

mod/toggle_mobile.php
src/App.php
src/Core/System.php
tests/src/Core/SystemTest.php

index ad77dd1ccd07c5dda7fc29dae321cd29b5b4416e..388c40891a80b2d64419e96daf6d775f1bd82361 100644 (file)
@@ -17,5 +17,5 @@ function toggle_mobile_init(App $a) {
                $address = '';
        }
 
-       $a->internalRedirect($address);
+       System::externalRedirect($address);
 }
index 8cd3b74f99483a11f5a009cbfb402280016257b2..0ba82077985774e9728d03afc27d17758a7a0e67 100644 (file)
@@ -2000,7 +2000,7 @@ class App
        public function internalRedirect($toUrl = '', $ssl = false)
        {
                if (filter_var($toUrl, FILTER_VALIDATE_URL)) {
-                       throw new InternalServerErrorException('URL is not a relative path, please use System::externalRedirectTo');
+                       throw new InternalServerErrorException("'$toUrl is not a relative path, please use System::externalRedirectTo");
                }
 
                $redirectTo = $this->getBaseURL($ssl) . '/' . ltrim($toUrl, '/');
index e071866ee9bb54845ca0c1d2a2107cd11634777a..6079d9e22855d922a3072f9b06804725b5012872 100644 (file)
@@ -247,7 +247,7 @@ class System extends BaseObject
        public static function externalRedirect($url)
        {
                if (!filter_var($url, FILTER_VALIDATE_URL)) {
-                       throw new InternalServerErrorException('URL is not a fully qualified URL, please use App->internalRedirect() instead');
+                       throw new InternalServerErrorException("'$url' is not a fully qualified URL, please use App->internalRedirect() instead");
                }
 
                header("Location: $url");
index b85bce44cb87df88d750c7ad386461230a47ab98..6b0781198a52ee828121771141c9f3cf4f4ac014 100644 (file)
@@ -34,4 +34,4 @@ class SystemTest extends TestCase
                $guid = System::createGUID(23, 'test');
                $this->assertGuid($guid, 23, 'test');
        }
-}
\ No newline at end of file
+}