Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15429979
D16009.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16009.diff
View Options
diff --git a/src/parser/PhutilURI.php b/src/parser/PhutilURI.php
--- a/src/parser/PhutilURI.php
+++ b/src/parser/PhutilURI.php
@@ -76,10 +76,10 @@
$auth = '';
if (strlen($this->user) && strlen($this->pass)) {
- $auth = phutil_escape_uri($this->user).':'.
- phutil_escape_uri($this->pass).'@';
+ $auth = rawurlencode($this->user).':'.
+ rawurlencode($this->pass).'@';
} else if (strlen($this->user)) {
- $auth = phutil_escape_uri($this->user).'@';
+ $auth = rawurlencode($this->user).'@';
}
$prefix = $protocol.'://'.$auth.$this->domain;
diff --git a/src/parser/__tests__/PhutilURITestCase.php b/src/parser/__tests__/PhutilURITestCase.php
--- a/src/parser/__tests__/PhutilURITestCase.php
+++ b/src/parser/__tests__/PhutilURITestCase.php
@@ -65,6 +65,11 @@
$this->assertEqual('@', $uri->getPass());
$this->assertEqual('http://%40:%40@domain.com/', (string)$uri);
+ $uri = new PhutilURI('http://%2F:%2F@domain.com/');
+ $this->assertEqual('/', $uri->getUser());
+ $this->assertEqual('/', $uri->getPass());
+ $this->assertEqual('http://%2F:%2F@domain.com/', (string)$uri);
+
// These tests are covering cases where cURL and parse_url() behavior
// may differ in potentially dangerous ways. See T6755 for discussion.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 25, 5:07 AM (3 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705864
Default Alt Text
D16009.diff (1 KB)
Attached To
Mode
D16009: Escape forward slashes in URI usernames/passwords properly
Attached
Detach File
Event Timeline
Log In to Comment