The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Escape Characters and Quotation Marks - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Escape Characters and Quotation Marks (/showthread.php?tid=2999) |
Escape Characters and Quotation Marks - grahame - Apr 22nd, 2014 Hi I am sure this is a problem common to many PHP installations but I was wondering how to fix it specifically in a form-tools installation? I have a text area on a form. If I add Quote:this is a quote by me; "why do I keep getting escape characters repeated?" each time the submission is updated I get extra escape characters Quote:this is a quote by me; \\\"why do I keep getting escape characters repeated?\\\"then, after 3 or 4 updates Quote:this is a quote by me; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"why do I keep getting escape characters repeated?\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" To get around storage of this I use stripslashes and str_replace functions in a hook in ft_update_submission, start. But although it is getting stored correctly in MYSQL it still insists on displaying them as above? Is there is a global variable or whatever that I can set to prevent this behaviour rather than use code hooks? RE: Escape Characters and Quotation Marks - grahame - Apr 23rd, 2014 I have solved this problem but it took some finding. I have a code hook in ft_update_submission,start. Although it appeared to be working there must have been a problem with it. However this problem was not flagged in edit_submission.php i.e. Code: list($g_success, $g_message) = ft_update_submission($form_id, $submission_id, $request); Both $g_success and $g_message were being returned as NULL. Later in edit_submission.php there is a call thus:- Code: $grouped_fields = ft_get_grouped_view_fields($view_id, $tab_number, $form_id, $submission_id); Because $failed_validation was true, the merge code here (I think) just kept adding the POST'd values to themselves and (I think) was causing the multiple slashes to appear. I corrected my hook and everything behaved itself again I wonder if this should be flagged up to Ben/Joe?? RE: Escape Characters and Quotation Marks - Joe - Apr 25th, 2014 Hey Grahame, Thanks for posting your solution. We'll take a closer look at this. Could you post into our bug tracker please? Thanks so much. Cheers, Joe RE: Escape Characters and Quotation Marks - grahame - Apr 27th, 2014 Hi Would be happy to but, actually, I have done a little more digging around on this. I had code in the hooks manager for 'ft_update_submission, start' and 'end'. When ft_update_submission was called by edit_submission.php thus Code: list($g_success, $g_message) = ft_update_submission($form_id, $submission_id, $request); Now although my code was actually working, there are two override variables in the hook manager... $success and $message which I was not manipulating. They were defaulting to NULL. So I don't think this is a bug per se but rather my misunderstanding that there was a requirement for $success and $message to be set to true by the code in the hook?? |