> Ok merci, je vais voir à merger tout ça sur le SVN... J'avais fait > quelque chose à ce sujet, mais peut être une amélioration est-elle > possible :) > >
ok mon code php n'est surement pas très 'pro', je suis débutant dans ce domaine, donc il y a certainement des façons d'écrire ça en plus court/plus propre... mais ça marche ;) > Heu... Le warning vient du navigateur, pas du parseur :) > > Les pages sont envoyées avec une déclaration XML, si le XML n'est pas > valide, le browser va alors refuser d'afficher la page. Peut être un > coup de tidy pourrait résoudre ce problème ? À vrai dire, je n'ai aps du > tout testé ce genre de choses, je n'envoie que des mails au format texte :p > Ah... ok ;) J'ai regardé la doc de tidy, c'est une super extension... J'ai testé, ci-dessous modif à faire dans le bloc '#si le mail est en html'. Cela ne marche que si l'extension tidy est installée... j'ai pas trouvé d'include externe (comme gettext par exemple). Il faudrait également regénérer le .po pour la nouvelle erreur que j'ai inclue dans le code si tidy n'arrive pas à corriger. Kevin #si le mail est en html if (isset($_POST['mailing_html'])) { $data['mailing_html']=$_POST['mailing_html']; If (get_magic_quotes_gpc()==1) { $data['mailing_corps'] = htmlentities(stripslashes($_POST['mailing_corps'])); $data['mailing_corps_display']=nl2br(html_entity_decode($data['mailing_corps'])); $data['mailing_corps_to_send']=$data['mailing_corps_display']; } else { $data['mailing_corps'] = htmlentities($_POST['mailing_corps']); $data['mailing_corps_display']=nl2br(html_entity_decode($data['mailing_corps'])); $data['mailing_corps_to_send']=$data['mailing_corps_display']; } #HTML check with Tidy If (extension_loaded('tidy')) { $tidy_config = array( 'doctype' => omit, 'output-xhtml' => true, 'show-warnings' => false, 'show-body-only' => true); $tidy = new tidy(); $tidy->parseString(html_entity_decode($data['mailing_corps_to_send']),$tidy_config); $tidy->cleanRepair(); if ($tidy->errorBuffer) { $error_detected[] = _T("You have HTML syntax error(s):").'<p>'.htmlentities($tidy->errorBuffer).'</p>'; } else { $data['mailing_corps_to_send'] = $tidy; $data['mailing_corps_display'] = $tidy; $data['mailing_corps'] = htmlentities($tidy); } } } _______________________________________________ Galette-devel mailing list Galette-devel@gna.org https://mail.gna.org/listinfo/galette-devel