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
F15483971: D10515.diff
Wed, Apr 9, 3:30 PM
F15483970: D10515.diff
Wed, Apr 9, 3:30 PM
F15421601: D10515.id25266.diff
Sat, Mar 22, 1:14 AM
F15419149: D10515.id25262.diff
Fri, Mar 21, 3:59 AM
F15416353: D10515.id25261.diff
Thu, Mar 20, 10:36 AM
F15414479: D10515.id.diff
Thu, Mar 20, 12:49 AM
F15402120: D10515.diff
Mon, Mar 17, 8:46 PM
F15391209: D10515.id25261.diff
Mar 15 2025, 8:44 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.