Fix escaped special chars in urlencoded parameters string incorrectly normalized #5771

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
6 participants
Member

Xerkus commented Jan 31, 2014

This pull request fixes #5769

@samsonasik samsonasik commented on the diff Feb 1, 2014

library/Zend/Uri/Uri.php
@@ -1321,7 +1323,14 @@ protected static function normalizeQuery($query)
*/
protected static function normalizeFragment($fragment)
{
- return static::normalizeQuery($fragment);
+ $fragment = self::encodeQueryFragment(
@samsonasik

samsonasik Feb 1, 2014

Contributor

use static::encodeQueryFragment instead of self::

@Xerkus

Xerkus Feb 1, 2014

Member

But should it be static? I do not see where that can change and might require override by subclassing

@Ocramius

Ocramius Feb 1, 2014

Member

Can't really know that. I'd argue that the entire method should be private then instead.

@mwillbanks

mwillbanks Mar 3, 2014

Contributor

Someone might do special processing; so it would make sense to keep it static for now.

@EvanDotPro

EvanDotPro Mar 3, 2014

Member

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(
@Ocramius

Ocramius Mar 4, 2014

Member

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.

weierophinney added this to the 2.2.6 milestone Mar 3, 2014

@Ocramius Ocramius added a commit to Ocramius/zf2 that referenced this pull request Mar 4, 2014

@Ocramius Ocramius Moving excluded special characters to constant as of #5771 207d419

@Ocramius Ocramius added a commit to Ocramius/zf2 that referenced this pull request Mar 4, 2014

@Ocramius Ocramius Merge branch 'hotfix/#5771-escape-special-urlencoded-parameters-in-uri'
Close #5771
18154d8

@Ocramius Ocramius added a commit to Ocramius/zf2 that referenced this pull request Mar 4, 2014

@Ocramius Ocramius Merge branch 'hotfix/#5771-escape-special-urlencoded-parameters-in-ur…
…i' into develop

Close #5771
Forward port #5771
36a6f03

Ocramius closed this in 18154d8 Mar 4, 2014

Ocramius self-assigned this Mar 4, 2014

@Ocramius Ocramius added Uri bug labels Mar 4, 2014

@gianarb gianarb pushed a commit to zendframework/zend-uri that referenced this pull request May 15, 2015

@Ocramius Ocramius Moving excluded special characters to constant as of zendframework/ze… c3f70de

@gianarb gianarb pushed a commit to zendframework/zend-uri that referenced this pull request May 15, 2015

@Ocramius Ocramius Merge branch 'hotfix/zendframework/zf2#5771-escape-special-urlencoded…
…-parameters-in-uri'

Close zendframework/zendframework#5771
f58c365

@gianarb gianarb pushed a commit to zendframework/zend-uri that referenced this pull request May 15, 2015

@Ocramius Ocramius Merge branch 'hotfix/zendframework/zf2#5771-escape-special-urlencoded…
…-parameters-in-uri' into develop

Close zendframework/zendframework#5771
Forward port zendframework/zendframework#5771
fe42eb7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment