-
Notifications
You must be signed in to change notification settings - Fork 152
reserved characters in path should be unencoded #258
reserved characters in path should be unencoded #258
Conversation
8aebdee
to
93f68cf
Compare
@@ -556,7 +556,7 @@ private function filterScheme($scheme) | |||
private function filterPath($path) | |||
{ | |||
$path = preg_replace_callback( | |||
'/(?:[^' . self::CHAR_UNRESERVED . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', | |||
'/(?:[^(' . self::CHAR_UNRESERVED . '):@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing the way you have it written; it looks like a mistake, though it's not.
I thought at first you were trying to create a capturing group by placing parens, and, since this expression is within square brackets, that would not work.
What you are trying to do is add parens to the character list, and, as such, it's not a mistake. It just reads like one.
As such, when I merge, I'm going to disambiguate and push them both into the concatenated string. Further, one common practice when writing a character group for a regex is to flip the order of parens, braces, etc: )(
instead of ()
. This helps ensure that you don't accidentally create a capturing group, a character group, or a quantifying expression.
reserved characters in path should be unencoded
Thanks, @samsonasik |
@weierophinney Thank you, I've updated the zend-uri PR at zendframework/zend-uri#17 to use |
like in zend-uri issue zendframework/zend-uri#13 with zend-uri PR zendframework/zend-uri#17