Michał Minicki wrote:
> Colin Guthrie <[EMAIL PROTECTED]> napisał(a):
> 
>> Anyway, I'm using Zend_Controller_Router_Route_Regex, and have found
>> some odd behaviour that I'm not 100% sure is deliberate and wonder if
>> someone could confirm this is expected or if it's actually a bug!
> 
> Why don't you look at the code and the test suite? Regex route does this as 
> a first line when matching path_info:

Yeah I guess I should have, but then I'd only be posting a question
asking why anyway. I figured those that knew ZF inside out would know
the reasoning too :)

I guess I should have looked tho', so sorry for that part.

> $path = trim(urldecode($path), '/');
> 
> First of all it's being done in order to be consistent with the rest of the 
> routes which behave similarly.
> 
> Secondly, there were some issues reported on JIRA regarding the issue - you 
> can read them if you want additional info. As far as I remember regex route 
> used to do only ltrim in the beginning.

Hmmm, interesting. My initial reaction would be that this is
inconsistent with regular expression matching and produces cases the
like the one I presented. If you want to trim off the trailing /'s it's
possible in most cases to construct your regexp such that it does this
for you.

I was about to say: "It should at very least be made clear in the docs
that this is happening." but on second reading I see it's there:
http://www.framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.regex
Ahh well, I guess that should have been obvious then! Sorry!

I'll try and find JIRA and find out the info you're referring to.

Col

Reply via email to