Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

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

Closed
Xerkus wants to merge 1 commit into
zendframework:masterfrom
Xerkus:hotfix/zend-uri-query-normalize
Closed

Fix escaped special chars in urlencoded parameters string incorrectly normalized#5771
Xerkus wants to merge 1 commit into
zendframework:masterfrom
Xerkus:hotfix/zend-uri-query-normalize

Conversation

@Xerkus
Copy link
Copy Markdown
Member

@Xerkus Xerkus commented Jan 31, 2014

This pull request fixes #5769

Comment thread library/Zend/Uri/Uri.php
Copy link
Copy Markdown
Contributor

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::

Copy link
Copy Markdown
Member Author

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

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member

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(

Copy link
Copy Markdown
Member

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.

@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014
Ocramius added a commit to Ocramius/zf2 that referenced this pull request Mar 4, 2014
Ocramius added a commit to Ocramius/zf2 that referenced this pull request Mar 4, 2014
@Ocramius Ocramius closed this in 18154d8 Mar 4, 2014
@Ocramius Ocramius self-assigned this Mar 4, 2014
gianarb pushed a commit to zendframework/zend-uri that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-uri that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-uri that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zend\Uri\Uri::normalizeQuery bug: decodes special characters in query params. Affects assembled routes

6 participants