diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php index 617fb57af9..a471874e43 100644 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -433,7 +433,7 @@ final class PhabricatorEnv extends Phobject { $host = $uri->getDomain(); if (!phutil_nonempty_string($host)) { - return false; + return true; } $host = phutil_utf8_strtolower($host); diff --git a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php index f73299aa12..59e925f15c 100644 --- a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php +++ b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php @@ -243,6 +243,12 @@ final class PhabricatorEnvTestCase extends PhabricatorTestCase { 'https://old.example.com/path/to/resource.png' => true, 'https://other.example.com/' => false, + + '/' => true, + '/self' => true, + '#self' => true, + '/#self' => true, + '/self/#self' => true, ); foreach ($map as $input => $expect) {