Ya lo he resuelto he creado las siguientes funciones en php:
Código PHP:
function FixTextFields($text) {
$text = SafeStripSlashes($text);
$text = htmlentities($text, ENT_QUOTES);
return $text;
}
function SafeStripSlashes($text) {
if (get_magic_quotes_gpc()) {
return stripslashes($text);
}
return $text;
}
Y con esto llamo a mi cadena de texto asi:
FixTextFields(SafeStripSlashes($cadena));
Bien pues asunto resuelto, espero que le sirva para alguien más.