• Some of my forms have fields with single quotes (either in description or in data). As such, it’s impossible to toggle the status (read/unread). Example data:

    form_id
    3
    
    form_post_id
    891
    
    form_value
    a:9:{s:16:"WPFormsDB_status";s:6:"unread";s:28:"Nom du rédacteur du rapport";s:3:"x x";s:22:"Courriel du rédacteur";s:11:"[email protected]";s:46:"Date, heure et lieu approximatif de l'incident";s:4:"asda";s:25:"Nom du capitaine de route";s:0:"";s:67:"No de la plaque d’immatriculation (si un véhicule est impliqué)";s:0:"";s:79:"Nom du membre dont le comportement répréhensible est soulevé (si applicable)";s:0:"";s:37:"Brève description de l’événement";s:5:"adsad";s:59:"Observations de l’état physique ou mental de la personne";s:0:"";}
    

    To get around this, you need to modify class-sub-page.php and class-form-details.php to escape $form_data string with addcslashes function:

    ...
    $form_data = serialize( $form_data );
    $form_data = addcslashes($form_data, "'");
    ...

    I found 3 occurences where this must be changed.

    • This topic was modified 6 years, 5 months ago by clauded007.
    • This topic was modified 6 years, 5 months ago by clauded007.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Error saving to DB when fields have single quotes’ is closed to new replies.