After much digging, I'm now able to sort of answer myself, in case
anyone else hits this. I don't think this is a cake issue - which is
why the router/dispatcher tests pass OK. The problem appears to stem
from the .htaccess - the 'url' is derived from the $1 (i.e. everything
after the domain name) which, because it has an '&' in it, gets split
into two elements in the params['url'] - despite the '&' being
encoded.

I thought adding 'NE' to the .htaccess RewriteRule might do the trick,
but no joy. Unless anyone can tell me otherwise, I think this means
'%26' cannot be used in cake urls unless they are in the query string.

~GreyCells

On Apr 16, 8:16 pm, "GreyCells" <[EMAIL PROTECTED]> wrote:
> When using urlencode (or rawurlencode), any keys set up in Routes
> appear to truncate at the first special character.
>
> This is my test case:
>
>                 Router::connect('/search/:searchName', array('controller' =>
> 'search', 'action' => 'saved'));
>                 $result = Router::parse('/search/Fred%20%26%20Barney');
>                 $expected = array('searchName' => 'Fred%20%26%20Barney',
> 'controller' => 'search', 'action' => 'saved', 'plugin' =>'');
>                 $this->assertEqual($result, $expected);
>
> which passes, but the following appears in $this->params:
>
>     [searchName] => Fred
>     [url] => Array
>         (
>             [url] => search/Fred
>             [Barney] =>
>         )
>
> I expect the searchName to be 'Fred%20%26%20Barney' and the url to be
> '/search/Fred%20%26%20Barney', but can't work out how to write the
> test case to prove it:)
>
> ~GreyCells


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to