We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Form field adding \' on sumission

When I write something like " Let's go " on any of my text fields, they're being saved as " Let\'s go " on the DB. I have tracked this string being like this already in the BeforeValidation event in the Form object that receives it. What am I missing?

Here's an example of the field definition in the form object for one of the problem fields:

    $about = new Textarea("about");
    $about->setFilters(array('trim', 'striptags'));


It seems that magic_quotes_gpc is enabled in your system so any ' or " is automatically escaped by PHP

You can disable it in your php.ini or in the VirtualHost configuration by adding:

php_flag magic_quotes_gpc Off


Thanks so much. That was it