-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix escaped special chars in urlencoded parameters string incorrectly normalized #5771
Fix escaped special chars in urlencoded parameters string incorrectly normalized #5771
Conversation
…orectly normalized.
@@ -1321,7 +1323,14 @@ protected static function normalizeQuery($query) | |||
*/ | |||
protected static function normalizeFragment($fragment) | |||
{ | |||
return static::normalizeQuery($fragment); | |||
$fragment = self::encodeQueryFragment( |
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.
use static::encodeQueryFragment
instead of self::
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.
But should it be static? I do not see where that can change and might require override by subclassing
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.
Can't really know that. I'd argue that the entire method should be private then instead.
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.
Someone might do special processing; so it would make sense to keep it static for now.
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.
I'm not stating which way should be used, but thought it's worth mentioning that Uri::encodeQueryFragment()
is called via both static
and self
currently...
Uri.php:385: $uri .= "?" . static::encodeQueryFragment($this->query);
Uri.php:389: $uri .= "#" . static::encodeQueryFragment($this->fragment);
Uri.php:1304: $query = self::encodeQueryFragment(
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.
I'm going with self
here, since this is the standardized way of dealing with an URI, and there's really no need for overriding logic here.
…ameters-in-uri' into develop Close zendframework#5771 Forward port zendframework#5771
…urlencoded-parameters-in-uri' Close zendframework/zendframework#5771
…urlencoded-parameters-in-uri' into develop Close zendframework/zendframework#5771 Forward port zendframework/zendframework#5771
This pull request fixes #5769