开发者

CakePHP encoding html entities

Greetings,

I'm having a strange issue with data sent to Cake via URL path. If the path includes url encoded entities, the encoded chars appear to get stripped off and the rest of the URL path is not getting passed to my controller. For example:

http://mydomain.com/products/search/pants+%26%2A%25+shoes/1/pg-2/

This should pass the string pants &*% shoes to my products controller's search() action as the first argument, with 1 and pg-2 as the oth开发者_Python百科er two args. But instead I just get pants (with trailing space) as the first arg and no second or third arg. I have made sure the Sanitize class is not being used and I have Configure::write('App.encoding', 'UTF-8'); set.

Any thoughts?

Thanks bunches,

-saturn

Update: Cake is seeing %26 as an ampersand separator of query string arguments. Shouldn't Cake know the difference between a query string separator and a literal char? Or am I missing something bleeding obvious? (I have been working a lot of hours...)

Update 2: I think this may be a bug. If I pass a URL like:

http://mydomain.com/products/search/?q=pants%20%2A%24%25%5E%26%20shoes&cat=1&pg=2

Cake parses it correctly, that is, the various args are stored as query string params in $this->params['url']. The hiccup appears to be only when using an encoded ampersand in the URL path.

By the way, I'm using the latest Cake 1.3.6.

I'm very interested to know anyone else's opinion on this. Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜