From 7a3382a6cb5268e9ea54f591d21afbe1b0a38665 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 3 Mar 2015 16:10:15 -0600 Subject: [PATCH 1/3] Added language to withPath() regarding percent encoding Per RFC 3986, section 2, reserved characters must be percent encoded. Additionally, the implementation must not double-encode. --- src/UriInterface.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/UriInterface.php b/src/UriInterface.php index bdf68c7..532843c 100644 --- a/src/UriInterface.php +++ b/src/UriInterface.php @@ -205,6 +205,10 @@ public function withPort($port); * The path MUST be prefixed with "/"; if not, the implementation MAY * provide the prefix itself. * + * The implementation MUST percent encode reserved characters as + * specified in RFC 3986, Section 2, but MUST NOT double-encode any + * characters. + * * An empty path value is equivalent to removing the path. * * @param string $path The path to use with the new instance. From 6a3d8f167ea576d24332ebe5f31f48a5d7dfa3df Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 3 Mar 2015 16:40:21 -0600 Subject: [PATCH 2/3] Encoding pertains to the query string as well --- src/UriInterface.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/UriInterface.php b/src/UriInterface.php index 532843c..6bad904 100644 --- a/src/UriInterface.php +++ b/src/UriInterface.php @@ -227,6 +227,10 @@ public function withPath($path); * Additionally, the query string SHOULD be parseable by parse_str() in * order to be valid. * + * The implementation MUST percent encode reserved characters as + * specified in RFC 3986, Section 2, but MUST NOT double-encode any + * characters. + * * An empty query string value is equivalent to removing the query string. * * @param string $query The query string to use with the new instance. From 6fa1059f87232cd7872a43b64c50e94fe7a5e76e Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 4 Mar 2015 14:09:39 -0600 Subject: [PATCH 3/3] s/percent encode/percent-encode/ - to match language of RFC 3986 --- src/UriInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UriInterface.php b/src/UriInterface.php index 6bad904..9a67725 100644 --- a/src/UriInterface.php +++ b/src/UriInterface.php @@ -205,7 +205,7 @@ public function withPort($port); * The path MUST be prefixed with "/"; if not, the implementation MAY * provide the prefix itself. * - * The implementation MUST percent encode reserved characters as + * The implementation MUST percent-encode reserved characters as * specified in RFC 3986, Section 2, but MUST NOT double-encode any * characters. * @@ -227,7 +227,7 @@ public function withPath($path); * Additionally, the query string SHOULD be parseable by parse_str() in * order to be valid. * - * The implementation MUST percent encode reserved characters as + * The implementation MUST percent-encode reserved characters as * specified in RFC 3986, Section 2, but MUST NOT double-encode any * characters. *