I’m using Symfony2 version 2.0.5 with the bundled Doctrine ORM solution. Since I changed the environment from dev to prod, all my form inputs are escaped, when persisting to database. Now I know this is the correct behaviour for preventing sql injections, but when fetching the data back, the string isn’t unescaped. Because I directly save JSON strings to database this is causing me big problems.
Also everytime I update this data the string gets escaped again and again.
My Question is, can I deactivate the escaping for certain fields, should I? Or can I unescape the values when fetched from the DB.
And why is this only happening in prod environment? Is this intended?
Best Regards, David!
This is probably caused by PHP configuration — not by Symfony or Doctrine. In
php.ini, find all options starting withmagic_quotes_and set them toOff. Don’t forget to restart the server.