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()
121121 $ url = null ;
122122
123123 if ($ this ->scheme ) {
124- $ url .= urlencode ( $ this ->scheme ) . ':// ' ;
124+ $ url .= $ this ->scheme . ':// ' ;
125125 }
126126
127127 if ($ this ->user ) {
Original file line number Diff line number Diff line change @@ -149,4 +149,19 @@ public function testIdnToAscii()
149149
150150 $ this ->assertEquals ($ expected , $ actual );
151151 }
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+ }
152167}
You can’t perform that action at this time.
0 commit comments