2
These are the two functions from myts:
function addSlashes($text)
{
if (!get_magic_quotes_gpc()) {
$text = addslashes($text);
}
return $text;
}
function stripSlashesGPC($text)
{
if (get_magic_quotes_gpc()) {
$text = stripslashes($text);
}
return $text;
}
So, they take both already in account for the magic quotes.
AFAIK, it is sufficient to use only the $myts->addSlashes function before storing a form value to the database.
For displaying it depends on the origin of the data: from the database it can be displayed as it is. If it is from the form (GPC) then it has to pass the stripSlashesGPC.
If it is a variable submitted to $myts->addSlashes, then it should be processed by the PHP (!) function stripslashes.
It is very important to know in every step of the program the condition of the variables, and not to repeat any of the conversions, because this will have a data change as a result.
displayTarea does nothing with stripslashes and assume a clean variable. previewTarea assumes a (GPC) variable and does a stripSlashesGPC.