Long URL Problem in CHttpRequest

Hi! I joined the Yii forum to get awareness of a problem I encountered.

I have a form and a grid which is populated based on the information sent by the form. The form is using a model that has a long name. When I get the pages numbers for the grid and I click on any of them, I then get an aborted or canceled request due to the fact that the generated URL is long (because I have a lot of fields and the model name is long).

I debugged and found out the problem was the use of preg_match inside CHttpRequest->urldecode(). I have read that preg_match has stack overflow bugs and that many people has suffered from this as well (including me) so I found the answer at stackoverflow dotcom (ironically).

I inserted


ini_set("pcre.recursion_limit", "524"); 

before preg_match and it fixed it.

So if you are struggling with this, well, that’s a fast work around… but I would encourage the use of another function other than preg_match in CHttpRequest.php (if there is any).