On 16.04.2011 09:14, Theo Chakkapark wrote:
> I have a routing definition that's pretty standard:
> 
> example:
>     pattern:   /test/{email_address}
>     defaults:  { _controller: SomeBundle:Example:show }
> 
> When doing something like
> /test/t...@test.com
> 
> The controller is not able to pick it up. Even urlencoding/decoding
> does not work (does not seem to like the period in the email).
> 
> Any pointers?
> 
> There seems to be a solution for Symfony 1.x where you omit certain
> lines in .htaccess, but those lines do not exist in the Symfony
> 2.x .htaccess


By default the dot is used as a pattern separator, so it's not matched.
In this case you should override the requirements for that parameter as
such:

example:
    pattern:   /test/{email_address}
    defaults:  { _controller: SomeBundle:Example:show }
    requirements:
        email_address: '.+@.+'

Note that this is a regex pattern, .+ would suffice, but you might as
well validate that there is at least an @ in there while you're at it.

Cheers

-- 
Jordi Boggiano
@seldaek :: http://seld.be/

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to