Folks,
I'm using Apache/1.3.28 (SuSE 7.1, kernal 2.4) with PHP/4.3.2. I have the
following code to help cleanse form data.
function cleanData($sour ceData, &$cleanData)
{ foreach($myData as $fieldName=>$fi eldValue)
{ if(strlen($fiel dValue)>0)
{ $cleanData[$fieldName]=htmlentities(t rim($fieldValue )); }
else
{ $cleanData[$fieldName]=""; }
}
return;
}
cleanData($_POS T, $formData);
I tested the code and found a \ was placed before double quotes
automatically - I have had to use stripslashes to clean the offending
slashes but I was wondering why they appeared the first place. A view
source of my html code, via my client browser produced the following (until
I used stripslashes which removed the slashes).
\"here\&qu ot;
What is the recommended action here? Is it something I need switch off in
php.ini or is it safer for me just to continue and use stripslashes as part
of my function?
Thanks
randelld
Comment