Issues

ZF-6661: Make routers, especially Zend_Controller_Router_Route_Regex, UTF8 compatible

Issue Type: Improvement Created: 2009-05-14T14:01:16.000+0000 Last Updated: 2012-11-20T20:52:51.000+0000 Status: Closed Fix version(s): Reporter: Aleksey Rechinskiy (arech) Assignee: None Tags: - Zend_Controller

Related issues: Attachments:

Description

Hi!

It would be very nice if Zend_Controller routers will be able to route a routes with an UTF8 symbols in it. That feature allows to create truly i18n web-sites, like Wikipedia.

It is very easy to add an UTF8 support to, for example, Zend_Controller_Router_Route_Regex - just add 'u' modifier to the route regexp:

Code starting at line 73:

public function match($path, $partial = false)
{
    if (!$partial) {
        $path = trim(urldecode($path), '/');
        $regex = '#^' . $this->_regex . '$#i';
    } else {
        $regex = '#^' . $this->_regex . '#i';
    }

just should be changed to

public function match($path, $partial = false)
{
    if (!$partial) {
        $path = trim(urldecode($path), '/');
        $regex = '#^' . $this->_regex . '$#iu';
    } else {
        $regex = '#^' . $this->_regex . '#iu';
    }

Adding unicode support slows down PHP PCRE engine and it would be wise to create a special construct-time flag to allow programmer decide if he/she really needs an UTF8 support in routes.

And as usual: thanks for the Framework! :)

Comments

Posted by Rob Allen (rob) on 2012-11-20T20:52:51.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts