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
F19102600: D10515.id25261.diff
Fri, Dec 5, 7:03 AM
F19097155: D10515.id25262.diff
Thu, Dec 4, 12:29 PM
F19080851: D10515.id25261.diff
Tue, Dec 2, 3:06 AM
F19048362: D10515.id25266.diff
Thu, Nov 27, 2:42 PM
F19048343: D10515.id25266.diff
Thu, Nov 27, 2:38 PM
F19034405: D10515.id.diff
Nov 25 2025, 2:13 PM
F19027845: D10515.diff
Nov 24 2025, 2:36 PM
F19009436: D10515.diff
Nov 21 2025, 11:32 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.