Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
}
if (!empty($this->ip)) {
$ip = ip_to_uint($this->ip);
}
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";
+ }
}
return join(" AND ", $where);
}
return join(" AND ", $where);