After updating my CakePHP version from 2.2.2 to 2.6.2, one of my routes stopped working properly.
Router::connect('/articles/:keywords', array('action' => 'search', 'controller' => 'Articles', 'keywords' => null), array('pass' => array('keywords'), 'keywords' => '[A-Za-z0-9\+_]+'));
It takes input such as "World" and "World+News" through a url such as website.com/articles/World+News and passes whatever is after articles/ to the search function in the Articles controller. This was working fine up until the update. Now it will pass up the route and go to my "cannot find route" route if there is anything other than alphanumeric characters. It's like the regex isn't matching properly. e.g. "World" and "World123" will work but "World+News" will not.
Things I have tried:
- Changing the regex to .* just to see if it works. It does.
- Changing the route from :keywords to * just to see if it works. It does.
- Trying something I know will fail such as excluding anything with letters in the match. It fails to use this route as expected.
I've been scouring everywhere, trying all sorts of regex combinations (the ones I have match successfully in the tester), and just generally trying to find out why this route will match but I cannot. This was working fine before the update and I can't find anything in the CakePHP documentation that would suggest why this isn't working. As far as I know the expressions have been right and I have confirmed that they fully match using a regex tester. Any help would be appreciated, thanks!