Thanks but I should have made it clear that I do urlencode the URL. I just didn't show the encoded URL here.
On Mar 17, 4:46 pm, Ryan Schmidt <[email protected]> wrote: > On Mar 17, 2011, at 13:24, [email protected] wrote: > > > I am having a problem with cache if the URL has apostrophe in it. > > > For example: > >www.example.com/controller/action/What'sMy Name > > > On first load when cache isn't there, it loads fine. However, once the > > cache is created, the subsequent load of the page causes PHP syntax > > error because in the cache file there is a line: > > > $controller->here = $this->here = '/controller/action/What's My > > Name?'; > > > Note the apostrophe isn't escaped and hence the PHP syntax error. > > > How can I fix this? Is this considered a bug in Cake? > > I don't know... does the problem still happen if you properly escape the > URLs? Spaces and apostrophes, among others, are not valid characters in URLs, > so your URL would properly be written: > > http://www.example.com/controller/action/What%27s%20My%20Name > > Or, if you're trying to make slugs, then you might want it to look like: > > http://www.example.com/controller/action/whats-my-name -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
