Bug #5182
Routing: @action should not be case sensitive
100%
Description
With the default routing setup, following is (and should be) possible:
http://localhost/TestInG/sTanDard/inDeX
However
http://localhost/testing/standard/Index
throws an exception
#1218473352: The action name must start with a lower case letter, "Index" does not match this criteria.
That should not happen.
I suggest to lower case all MVC parameters in the Router already, so that the request contains the same keys independently from the spelling.
Patch follows
Files
Related issues
Updated by Bastian Waidelich over 11 years ago
- File 5182_action_should_not_be_case_sensitive.patch 5182_action_should_not_be_case_sensitive.patch added
- Assignee changed from Bastian Waidelich to Karsten Dambekalns
Attached patch fixes the issue by lower-casing all MVC parameters (@package, @subpackage, @controller & @action) before storing them in the request object.
Note: @format is not lower cased yet, cause I'm not sure about the implications: Maybe someone wants to have somethink like "http://localhost/myroute.RSS" - does that make sense?
Updated by Bastian Waidelich over 11 years ago
- File 5182_action_should_not_be_case_sensitive_v2.patch 5182_action_should_not_be_case_sensitive_v2.patch added
- Target version set to 1.0 alpha 6
v2 of the patch also lower cases format and uses native strtolower() instead of the PHP6-methods, as discussed with Karsten
Updated by Bastian Waidelich over 11 years ago
- File 5182_action_should_not_be_case_sensitive_v3.patch 5182_action_should_not_be_case_sensitive_v3.patch added
v2 contained changes from another patch, sorry.
Updated by Karsten Dambekalns over 11 years ago
Bastian Waidelich wrote:
uses native strtolower() instead of the PHP6-methods, as discussed with Karsten
The rationale (for the record): Since those parts (package key, controller, action) reflect class and method names they cannot be unicode in PHP currently. As soon as they can be, strtolower()
can be expected to be able to deal with that.
Updated by Karsten Dambekalns over 11 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Applied in changeset r3384.