0) { $result .= "".$value."\n"; } } return $result; } function filtre_scrutari_textebrut($texte) { $u = $GLOBALS['meta']['pcre_u']; $texte = str_replace(" ", " ", $texte); $texte = preg_replace('/\s+/S' . $u, " ", $texte); $texte = str_replace("
", "\n\n", $texte); $texte = preg_replace("/<(p|br|li|h[1-6]|dd|dt)( [^>]*)?" . ">/iS", "\n\n", $texte); $texte = preg_replace("/^\n+/", "", $texte); $texte = preg_replace("/\n+$/", "", $texte); $texte = preg_replace("/\n +/", "\n", $texte); $texte = supprimer_tags($texte); $texte = filtrer_entites($texte); $texte = htmlspecialchars($texte, ENT_XML1 | ENT_QUOTES); return $texte; }