Still struggling with this one. After a bit more rigorous testing the above doesn't work :-(
Anyone who has fixed this issue want to share their wisdom? :-) On May 14, 4:39 pm, "rich...@home" <[email protected]> wrote: > After even more testing: > > Add the following to AppController beforeRender(): > > // HACK: double encode $this->passedArgs to get round % in > url bug > foreach($this->passedArgs as $key=>$value) { > > $this->passedArgs[$key] = > urlencode(urlencode($value)); > > } > > Fixes the pagination links > > Brain too tired to worry about the long term problems this might > introduce right now... > > On May 14, 4:06 pm, "rich...@home" <[email protected]> wrote: > > > Edit after more testing: > > > Still not good, paginator links doen't double encode so it breaks when > > a pagination link is clicked :-( > > > On May 14, 3:42 pm, "rich...@home" <[email protected]> wrote: > > > > More investigation: There's a related ticket open: > > > >https://trac.cakephp.org/ticket/5751 > > > > I've fixed it in the short turn by double urlencoding my parameters :- > > > S > > > > urlencode(urlencode($value)) > > > > Here's my code: > > > > function _buildFilter() { > > > > $url = array("action"=>"index"); > > > > foreach($this->data as $model=>$values) { > > > > foreach($values as $key=>$value) { > > > > $url["{$model}.{$key}"] = > > > urlencode(urlencode($value)); > > > > } > > > > } > > > > return $url; > > > > } > > > > - takes posted form data and returns a url array suitable for passing > > > into $this->redirect($url); > > > > On May 14, 3:08 pm, "rich...@home" <[email protected]> wrote: > > > > > I'm back trying to fix this issue and it's starting to be a bit of a > > > > pain :-( > > > > > This is definitely a problem with the default CakePHP setup because if > > > > I create a simple php file: > > > > > index.php: > > > > <?php > > > > > phpinfo(); > > > > > I can access the file withhttp://example.com/index.php?a=% > > > > and don't get a bad request (even though technically it IS a malformed > > > > url). > > > > > php parses it out to be: > > > > _SERVER["QUERY_STRING"] a=% > > > > > or with > > > > >http://example.com/index.php?a=%25 > > > > (a valid url) > > > > _SERVER["QUERY_STRING"] a=%25 > > > > > Malcolm's observation about double escaping appears to be right on the > > > > money. > > > > > So, dear CakePHP Dev's. What did you do on cakephp.org to stop %'s > > > > breaking the site? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
