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

Url parse problem #10

Open
kakaska opened this issue Jan 26, 2016 · 2 comments
Open

Url parse problem #10

kakaska opened this issue Jan 26, 2016 · 2 comments
Labels

Comments

@kakaska
Copy link

kakaska commented Jan 26, 2016

There is a bug when I would like to parse the following url:

/api/search/json?param_a=a&param_b[]=b&param_b[]=c

The $request->getRequestTarget() will be

/api/search/json?param_a=a&param_b%5B%5D=c

and $request->getUri()->getQueryValues() will be

array(2) {
  'param_a' =>
  string(1) "a"
  'param_b%5B%5D' =>
  string(1) "c"
}

Maybe you can use the default parse_str() function

@praswicaksono
Copy link

Im afraid query key also encoded, maybe due security reason https://github.com/icicleio/http/blob/master/src/Message/BasicUri.php#L488

@trowski
Copy link
Contributor

trowski commented Jan 27, 2016

I will have to re-examine how query values are stored and handled. I might have to change it to be like message headers, where the values are actually arrays (along with methods to access the value as a string or array, such as getQueryValue() and getQueryValueAsArray()).

I don't know what I was thinking pre-encoding the query values when they are stored, they should be stored decoded (perhaps even decoded when parsed from a URL). I'll also update this when I update value handling.

I'll update again once I've made some changes.

@trowski trowski added the bug label Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants