[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / inc / rechercher.php
index e289c73..f5ecc4b 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.     *
@@ -72,7 +72,7 @@ function expression_recherche($recherche, $options) {
        $recherche = trim($recherche);
 
        $is_preg = false;
-       if (substr($recherche,0,1)=='/' AND substr($recherche,-1,1)=='/'){
+       if (substr($recherche, 0, 1) == '/' and substr($recherche, -1, 1) == '/' and strlen($recherche) > 2) {
                // c'est une preg
                $recherche_trans = translitteration($recherche);
                $preg = $recherche_trans.$options['preg_flags'];