ZF-215: Support for all URI characters in Route's default regex

Issue Type: Improvement Created: 2006-07-09T07:21:00.000+0000 Last Updated: 2007-07-05T14:43:13.000+0000 Status: Resolved Fix version(s): - 0.6.0 (16/Dec/06)

Reporter: Michal Minicki (martel) Assignee: Michal Minicki (martel) Tags: - Zend_Controller

Related issues: Attachments:


Route should allow for all types of URI characters (as per RFC 3986).

Reported by Michael Sheakoski and Kirill Balyasnikov.

Here is the regex for full RFC 3986 support:

<pre class="literal">
const DEFAULT_REGEX = '[a-z0-9\-\_\.\~\!\*\'\(\)\;\:\@\&\=\+\$\,\?\%\#\[\]]+';

All characters are accounted for except / for obvious reasons :) -Michael Sheakoski


Posted by Michael Sheakoski (michael) on 2006-07-13T00:15:41.000+0000

Added DEFAULT_REGEX with RFC 3986 support

Posted by Simon Mundy (peptolab) on 2006-07-25T10:25:16.000+0000

A quick question - should the Router also be responsible for decoding URI's - e.g. reverting My+Search+String back to My Search String - before passing values back to the Dispatcher token? This is taken care of automatically with _GET and _POST superglobals but not, as far as I can tell, with parameters supplied from the router.

Posted by Michal Minicki (martel) on 2006-07-26T02:46:02.000+0000

I think it should be Zend_Http_Request's responsibility but since it's not here yet I'm simply not sure. It's a pretty easy thing to do and I have even prepared a unit test for such a case but there is still this hesitation.

Posted by Simon Mundy (peptolab) on 2006-07-26T22:09:43.000+0000

While Zend_Http_Request is non-existent then I think the Router should definitely handle the responsibility. Otherwise it will potentially cause confusion.

Posted by Bill Karwin (bkarwin) on 2006-11-13T15:13:46.000+0000

Changing fix version to 0.6.0.

Posted by Michal Minicki (martel) on 2006-11-14T02:31:51.000+0000

Now that the Request object exists it's again open for discussion. I'm not sure if it's a Router's responsibility to "url decode" Http_Request's parameters.

Posted by Michal Minicki (martel) on 2006-11-16T05:28:58.000+0000

I don't see the reason for implementing reserved characters in the Router. It won't be fixed unless someone comes up with a real world use case.

Have you found an issue?

See the Overview section for more details.


© 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.