For those wondering why Zend_Controller_Router_Route_Regex
matches case-different routes, eg. hxxp://example.com/EN vs. hxxp://example.com/en, here's an explanation.
Zend_Controller_Router_Route_Regex
is implicitly case insensitive. It is set in Zend_Controller_Router_Route_Regex::match()
method. This is the piece of code that sets PCRE_CASELESS
modifier:
if (!$partial) {
$path = trim(urldecode($path), '/');
$regex = '#^' . $this->_regex . '$#i';
} else {
$regex = '#^' . $this->_regex . '#i';
}
I do not know if there is any way to suppress this behavior from inside of the regular expression. Any ideas?