The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
The apostrophe . . . - 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: The apostrophe . . . (/showthread.php?tid=706)



The apostrophe . . . - rjhart - May 18th, 2010

Can someone give me a clue as to how FT handles apostrophe's in form data? Do I need to clean them PRIOR to giving data to FT or does FT do the cleaning some way?

Cleaning data has not been my strong point - any help would be appreciated.


RE: The apostrophe . . . - Ben - May 18th, 2010

Heya,

Don't worry - Form Tools takes care of it for you. All form input gets sanitized before it gets inserted into the database so all the SQL queries work properly.

All the best!

- Ben


RE: The apostrophe . . . - rjhart - May 19th, 2010

Hi Ben - thanks for the reply. My installation may not be working correctly then. My data is getting cutoff at the apostrophe.. Am I missing something? I just recently downloaded the most recent version - it was a new install, i did not download the API.

Ron


(May 18th, 2010, 4:09 PM)Ben Wrote: Heya,

Don't worry - Form Tools takes care of it for you. All form input gets sanitized before it gets inserted into the database so all the SQL queries work properly.

All the best!

- Ben

P.S. - My installation is on a secure site as well. https.....


RE: The apostrophe . . . - rjhart - May 20th, 2010

It appears as though I'm losing my data prior to it being submitted to FT. I am going to redo my forms attempting to utilize the API in a multi-form setting.

Not a FT problem ;-)


RE: The apostrophe . . . - dubq - May 23rd, 2012

Hi - I am new here so I hate to bump an old thread, but I am experiencing the same issue.

Any apostrophe that is copy and pasted from Word looks like this: ‘ and truncates the data.

Any apostrophe that is simply typed into the field (or copied from Notepad) is just fine. It looks like this: '

Anyone have a solution to this? It's really becoming a nightmare for the forms we're using since we're asking people to send in applications that were more than likely composed in Word.


RE: The apostrophe . . . - woodworm - Jun 14th, 2012

I bet this is the same problem as I am experiencing with my £ sign http://forums.formtools.org/showthread.php?tid=2030. I suspect Formtools is being a bit too enthusiastic with its sanitizing routine. There must be a way to fix this - perhaps by adding the rogue characters to a whitelist somewhere........
OK, I found the answer elsewhere, to my problem and possibly this one......

It was Ben suggested add the attribute <form ... accept-charset="UTF-8">


RE: The apostrophe . . . - michatmaster7 - Jun 17th, 2012

Thank you for searching and helping out woodworm!


RE: The apostrophe . . . - garof - Mar 16th, 2015

I have - I believe - a similar problem with apostrophes and quotes in the textbox input but with different results.

I have built a form to enter data from the label of products. Amonst the fields there is one for the brand name. In some cases, that amy include apostrophes, single or double quotes.

Unlike what the other users described, in my case the input doesn't get truncated but, instead, a backslash ("\") is placed before the apostrophe or the quotation mark. I understand that this may be part of the string sanitation that formtools performs. However, each time that an entry with a field containing an apostrophe or quotation mark is updated, an extra backslash is added.

So, for instance, the (hypothetical) brand name "Smith's" would be displayed as "Smith\'s". After another update of the entry that would become "Smith\\\'s" (which makes sense since the backslash needs shielding, too). Another update will lead to "Smith\\\\\\\'s, an so on.

I have verified that the input is saved as such in the database.

Is there any way to address that?

Thanks in advance for your time!

PS I am using FormTools v.2.2.6 and my form is a "Form builder" one.


RE: The apostrophe . . . (a solution) - garof - Mar 28th, 2015

Apologies for replying to my own post - it's not nice but I've used a workaround that may be of interest to some.

I created a rule in the Hooks Manager module on "ft_update, sumbission, end". In the PHP code box I added the following:

PHP Code:
{
$haystack="FieldName1FieldName2FieldName3FieldNameetc";

  foreach (
$_POST as $key => $value)

    {
    if (
strstr($haystack,$key))
       {
      
    
$tmp str_replace(array("\\'""\\\""), "`"$value);
    
$_POST[$key] = str_replace(array("\\\\"), "/"$tmp);
       }
     }


What the code does is go through all the text fields of the form, the names of which I have included in $haystack, look for backslashes (\), single quotes (') or double quotes, which upon submission have been changed by formtools to (\\), (\") and (\') and replace them with the forward slashes (/) or " ` " signs.

Thus, the phrase "Smith's restaurant\bar" would be transformed to "Smith`s restaurant/bar".

It is not an elegant solution and not what I was after in the first place (which was to retain the users' input) but for the moment is OKish.

I hope that helps!
G.


(Mar 16th, 2015, 12:57 PM)garof Wrote: I have - I believe - a similar problem with apostrophes and quotes in the textbox input but with different results.

I have built a form to enter data from the label of products. Amonst the fields there is one for the brand name. In some cases, that amy include apostrophes, single or double quotes.

Unlike what the other users described, in my case the input doesn't get truncated but, instead, a backslash ("\") is placed before the apostrophe or the quotation mark. I understand that this may be part of the string sanitation that formtools performs. However, each time that an entry with a field containing an apostrophe or quotation mark is updated, an extra backslash is added.

So, for instance, the (hypothetical) brand name "Smith's" would be displayed as "Smith\'s". After another update of the entry that would become "Smith\\\'s" (which makes sense since the backslash needs shielding, too). Another update will lead to "Smith\\\\\\\'s, an so on.

I have verified that the input is saved as such in the database.

Is there any way to address that?

Thanks in advance for your time!

PS I am using FormTools v.2.2.6 and my form is a "Form builder" one.