Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsed and unparsed uri is not a same #6

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed

Parsed and unparsed uri is not a same #6

weierophinney opened this issue Dec 31, 2019 · 2 comments

Comments

@weierophinney
Copy link
Member

Example:
$source_uri = '/?#';
$parsed_uri = Zend\Uri\UriFactory::factory($source_uri, 'http');
$unparsed_uri = $parsed_uri->toString();
echo $unparsed_uri; // we see '/', but must be same as source uri

It's because in Zend\Uri::toString() only host check on null. Can you fix it, please, and add check on null with other uri components? It will be more right behavior of this method.


Originally posted by @RubtsovAV at zendframework/zend-uri#5

@weierophinney
Copy link
Member Author

The query string and anchor are empty so there is no reason to put the '?' and '#' characters in the $unparsed_uri


Originally posted by @brian978 at zendframework/zend-uri#5 (comment)

@samsonasik
Copy link
Member

I agree with @brian978 , it doesn't make sense to parse empty query and fragment. Handle that will make a lot of edge case bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants