We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Controller not parsing parameter with special characters

Hello everyone, I'm having a problem with how the controller is parsing my parameter when Im using special characters.

So my route is declared as following

$applicants->addGet('/profile/{id}/update-status/{status_name}', array(
    'action'    => 'updateApplicantStatus',
    'id'        => 1,
    'status_name' => 2
))->setName('legacy-applicant-status-update'); 

and if my status_name is bucket #3 the uri encoded version looks like this: bucket%20%233 but the # and everything after it won't be parsed inside the controller, the result i get is bucket. Anyone has encountered this or has a solution to it?

edited Aug '20

I think this is a router issue rather than a controller. I think it's because of the regex that those named matches resolve to. Changing this to something like:

$applicants->addGet('/profile/{id}/update-status/(.*)', array(
    'action'    => 'updateApplicantStatus',
    'id'        => 1,
    'status_name' => 2
))->setName('legacy-applicant-status-update'); 

should catch it.