Browse Source

Making redirect message more informative

pull/6005/head
Philipp Holzer 3 years ago
parent
commit
3e6ea9383b
No known key found for this signature in database GPG Key ID: 517BE60E2CE5C8A5
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/App.php
  2. +1
    -1
      src/Core/System.php
  3. +1
    -1
      tests/src/Core/SystemTest.php

+ 1
- 1
src/App.php View 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, '/');


+ 1
- 1
src/Core/System.php View 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");


+ 1
- 1
tests/src/Core/SystemTest.php View File

@ -34,4 +34,4 @@ class SystemTest extends TestCase
$guid = System::createGUID(23, 'test');
$this->assertGuid($guid, 23, 'test');
}
}
}

Loading…
Cancel
Save