File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public function __toString()
121
121
$ url = null ;
122
122
123
123
if ($ this ->scheme ) {
124
- $ url .= urlencode ( $ this ->scheme ) . ':// ' ;
124
+ $ url .= $ this ->scheme . ':// ' ;
125
125
}
126
126
127
127
if ($ this ->user ) {
Original file line number Diff line number Diff line change @@ -149,4 +149,19 @@ public function testIdnToAscii()
149
149
150
150
$ this ->assertEquals ($ expected , $ actual );
151
151
}
152
+
153
+ /**
154
+ * Scheme should not be URL encoded
155
+ *
156
+ * @group issue46
157
+ *
158
+ * @see https://tools.ietf.org/html/rfc3986#section-3.1
159
+ */
160
+ public function testToStringDoesNotUrlEncodeScheme ()
161
+ {
162
+ // The '+' should not be URL encoded when output to string
163
+ $ spec = 'fake-scheme+RFC-3986.compliant://www.graphstory.com ' ;
164
+ $ url = $ this ->parser ->parseUrl ($ spec );
165
+ $ this ->assertEquals ($ spec , $ url ->__toString ());
166
+ }
152
167
}
You can’t perform that action at this time.
0 commit comments