@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix fatal during redirection safety check for searching for Phabricator base-uri with no trailing slash

Summary: Fixes T13412. If you search for "https://phabricator.example.com" with no trailing slash, we currently redirect you to "", which is fouled by a safety check in the redirection flow.

Test Plan:
- Searched for "https://local.phacility.com"; before: fatal in redirection; after: clean redirect.
- Searched for other self-URIs, got normal redirects.

Maniphest Tasks: T13412

Differential Revision: https://secure.phabricator.com/D20794

+11 -1
+11 -1
src/applications/meta/engineextension/PhabricatorDatasourceURIEngineExtension.php
··· 26 26 ->setProtocol(null) 27 27 ->setPort(null); 28 28 29 - return phutil_string_cast($uri); 29 + $uri = phutil_string_cast($uri); 30 + 31 + // See T13412. If the URI was in the form "http://dev.example.com" with 32 + // no trailing slash, there may be no path. Redirecting to the empty 33 + // string is considered an error by safety checks during redirection, 34 + // so treat this like the user entered the URI with a trailing slash. 35 + if (!strlen($uri)) { 36 + $uri = '/'; 37 + } 38 + 39 + return $uri; 30 40 } 31 41 32 42 return null;