[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / inc / pipelines.php
index b2eb236..1b3a83a 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2014                                                *
+ *  Copyright (c) 2001-2016                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -82,6 +82,13 @@ function f_surligne ($texte) {
               OR !isset($_SERVER['HTTP_REFERER'])))
                return $texte;
        include_spip('inc/surligne');
+       if (isset($_SERVER['HTTP_REFERER'])) {
+               $_SERVER['HTTP_REFERER'] = preg_replace(',[^\w\,/#&;-]+,', ' ', $_SERVER['HTTP_REFERER']);
+       }
+       if ($rech){
+               $rech = preg_replace(',[^\w\,/#&;-]+,', ' ', $rech);
+       }
+
        return surligner_mots($texte, $rech);
 }