Task #245
makeUrl doesn't handle query args and fragments correctly if its argument contains no slashes
| Status: | Closed | Start date: | 2010-03-19 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | Alex Cartwright | % Done: | 100% |
|
| Category: | - | |||
| Target version: | 2.6.0 | |||
| PHP Version: |
Description
$url = $this->_router->makeUrl('something?foo=bar');
There is no slashes in this path, so makeUrl will not treat it as a path. It will rather make a new instance of Router_Url (with no constructor arguments) and insert the one argument ('something?foo=bar') as a module with Router_Url::module(). Hence the "path" won't get parsed - the query string will not be saved nor extracted.
Same thing goes for fragments (#).
However, this will work as expected:
$url = $this->_router->makeUrl('something/again?foo=bar');
because there is a slash in the path. makeUrl will treat is as a path and hand it over to Router_Url which parses it.
History
Updated by Alex Cartwright almost 2 years ago
- File bug-245.patch added
- Status changed from New to Confirmed
- Assignee set to Alex Cartwright
- Priority changed from Undecided to Low
Thanks, patch attached to fix - will commit later
Updated by Alex Cartwright almost 2 years ago
- Status changed from Confirmed to Closed
- % Done changed from 0 to 100
Applied in changeset commit:"7bab0705974ad008b50cf93b1ad804d7733979fd".