X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins-dist%2Fsafehtml%2Finc%2Fsafehtml.php;h=e2b883aa7ea9c6b93f3df992b2de866963ee0b76;hb=4f443dce95ff6f8221c189880a70c74ce1c1f238;hp=06586267585c191f510e0c0312f2465d405ffc0e;hpb=4a628e9b277d3617535f99d663ca79fa2e891177;p=lhc%2Fweb%2Fwww.git diff --git a/www/plugins-dist/safehtml/inc/safehtml.php b/www/plugins-dist/safehtml/inc/safehtml.php index 06586267..e2b883aa 100644 --- a/www/plugins-dist/safehtml/inc/safehtml.php +++ b/www/plugins-dist/safehtml/inc/safehtml.php @@ -11,7 +11,9 @@ \***************************************************************************/ -if (!defined("_ECRIRE_INC_VERSION")) return; +if (!defined('_ECRIRE_INC_VERSION')) { + return; +} // Controle la presence de la lib safehtml et cree la fonction // de transformation du texte qui l'exploite @@ -22,15 +24,17 @@ function inc_safehtml_dist($t) { if (!$test) { $process = false; if ($f = find_in_path('lib/safehtml/classes')) { - define('XML_HTMLSAX3', $f.'/'); - require_once XML_HTMLSAX3.'safehtml.php'; + define('XML_HTMLSAX3', $f . '/'); + require_once XML_HTMLSAX3 . 'safehtml.php'; $process = new safehtml(); $process->deleteTags[] = 'param'; // sinon bug Firefox } - if ($process) - $test = 1; # ok - else - $test = -1; # se rabattre sur une fonction de securite basique + if ($process) { + $test = 1; + } # ok + else { + $test = -1; + } # se rabattre sur une fonction de securite basique } if ($test > 0) { @@ -45,15 +49,13 @@ function inc_safehtml_dist($t) { # $process->parse(''); # cas particulier ? $process->clear(); $t = $process->parse($t); - } - else - $t = entites_html($t); // tres laid, en cas d'erreur + } else { + $t = entites_html($t); + } // tres laid, en cas d'erreur // supprimer un
  • provenant d'un
  • ouvrant seul+safehtml // cf https://core.spip.net/issues/2201 - $t = str_replace("
  • ","",$t); + $t = str_replace('
  • ', '', $t); return $t; } - -?>