Problem/Motivation
The PHP's parse_str function has a data-loss problem for query params with the same name (which are valid according to the URL spec). It's now being wrapped into a method in UrlHelper in #3038774: Url only outputs the last value of a query parameter.
Proposed resolution
Use UrlHelper::parseString when it's available
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3052410-4.patch | 1.01 KB | jaimeah |
| #2 | 3052410-2.patch | 1 KB | blazey |
Comments
Comment #2
blazey commentedComment #3
dwwThanks for the patch! However, the upstream change still hasn't happened. Doesn't make sense to add conditional code here until the proposed function lives in *some* released version of core. ;) Calling this postponed for now.
Meanwhile, a few minor code style nits:
parse_str()
UrlHelper::parseString()
Needs newline before else.
Comment #4
jaimeah commentedThis is an excellent fix, but it fails against a different (related) patch at 2984272: Dots in query parameter names converted to underscores, so I am including a modified Patch so that it is compatible. Thank you!