Page MenuHomePhabricator

Parse unusual editor URIs with no domain in the way users expect
ClosedPublic

Authored by epriestley on Sep 18 2014, 3:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 7, 12:59 PM
Unknown Object (File)
Thu, May 1, 11:54 PM
Unknown Object (File)
Fri, Apr 25, 6:37 AM
Unknown Object (File)
Wed, Apr 23, 2:19 AM
Unknown Object (File)
Tue, Apr 22, 10:34 PM
Unknown Object (File)
Tue, Apr 22, 5:22 PM
Unknown Object (File)
Mon, Apr 21, 6:07 PM
Unknown Object (File)
Apr 9 2025, 3:30 PM
Subscribers

Details

Summary

Fixes T6106. See that task for additional dicussion. Specific issue is that if a URI has no path, but does contain a "/" in the query string, parse_url() does something unexpected.

$ php -r "var_dump(parse_url('idea://open?a=/'));"
array(3) {
  ["scheme"]=>
  string(4) "idea"
  ["host"]=>
  string(7) "open?a="
  ["path"]=>
  string(1) "/"

Instead, adjust these URIs so we get a more expected result.

Test Plan

Added failing unit tests and made them pass.

Diff Detail

Repository
rPHU libphutil
Branch
nodomainuri
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2572
Build 2576: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Parse unusual editor URIs with no domain in the way users expect.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
  • Slightly more readable (?) regular expression.
btrahan edited edge metadata.

Hairy stuff. Thanks for the test coverage!

This revision is now accepted and ready to land.Sep 18 2014, 3:23 PM
This revision was automatically updated to reflect the committed changes.