X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch%2Fclasses.inc.php;h=3d9088782a6a6e987b30d5e3de866223c42979d3;hb=aef0283bdf24c94d640a16ccac08191980ae7a25;hp=62a3ad7c32978340b507936d19dd7a40e338f8ae;hpb=b20ef4deed1b6fa6334bc57c0166a88e2beac9e4;p=platal.git diff --git a/modules/search/classes.inc.php b/modules/search/classes.inc.php index 62a3ad7..3d90887 100644 --- a/modules/search/classes.inc.php +++ b/modules/search/classes.inc.php @@ -342,7 +342,14 @@ class QuickSearch extends SField } if (!empty($this->ip)) { $ip = ip_to_uint($this->ip); - $where[] = "( ls.ip = $ip OR ls.forward_ip = $ip ) AND ls.suid = 0"; + + // If the IP address requested for the search cannot be translated, + // the predicate should always be valued to false. + if ($ip != null) { + $where[] = "( ls.ip = $ip OR ls.forward_ip = $ip ) AND ls.suid = 0"; + } else { + $where[] = "false"; + } } if (!empty($this->phone)){ require_once("profil.func.inc.php");