RegisterRoute breaking on "%"

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
demafkees
Forum Members
Forum Members
Posts: 10
Joined: Wed Nov 30, 2011 7:54 am

RegisterRoute breaking on "%"

Post by demafkees »

Hello everybody,

I have the following registered route defined in my module file:

Code: Select all

$this->RegisterRoute('/vragen\/(?P<rubriekID>[A-Za-z0-9]+)\/(?P<subrubriekID>[A-Za-z0-9]+)\/(?P<pagina>[0-9]+)\/(?P<zoektype>[0-9]+)\/(?P<zoekveld>[0-9a-zA-Z-%_\+ \']+)$/',array('action'=>'default','returnid'=>'72'));
"zoekveld" is supposed to be filled with the search string provided in the form. I urlencode the provided string, and decode it later.
Now, I am experiencing problems with the "%" character. When I have, for instance the following url:
$params['zoekveld'] should be filled with "question+%26+answer". However, it gets filled with "question " and the rest of the search string is gone.
Is my regular expression to blame or is $params filled incorrectly?
I am running CMS Made Simple 1.11 “Galapagos”.

Thanks in advance!
Post Reply

Return to “Developers Discussion”