CodeIgniter Forums
Having a problem with my db and CodeIgniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Having a problem with my db and CodeIgniter (/showthread.php?tid=69590)



Having a problem with my db and CodeIgniter - HFSVBC - 12-19-2017

Hi, I have a general text area field where clients write some text to be saved to the DB (MySQL). I have tried everything but it seems that PHP (or CodeIgniter not sure there) is converting '% de' into '\xDE' and the db is not being able to save the data. I have tried doing a manual update through PHPMyAdmin and it saves without a problem. Here is my db config:
Code:
'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => TRUE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE

Any help would be much appreciated.

Thanks Smile


RE: Having a problem with my db and CodeIgniter - Narf - 12-20-2017

Turn Off global_xss_filtering and/or stop using XSS filters on data that you save to a database. XSS escaping should be performed on OUTPUT, not input.