X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch%2Fclasses.inc.php;h=d232f11cb2d69744460e9c10b8e400b1e3d7bb20;hb=100e66fc8ab2b48621b287d50079558d83187278;hp=1d6a04740fdd24dda9b36e7031fb43d2ef0abafa;hpb=353f2d2b11c4e3c6c0bc3553813368b6f42fa9c6;p=platal.git diff --git a/modules/search/classes.inc.php b/modules/search/classes.inc.php index 1d6a047..d232f11 100644 --- a/modules/search/classes.inc.php +++ b/modules/search/classes.inc.php @@ -1,6 +1,6 @@ ip)) { - $join .= "INNER JOIN #logger#.sessions AS ls ON (ls.uid = u.user_id)\n"; + $join .= "INNER JOIN log_sessions AS ls ON (ls.uid = u.user_id)\n"; } if (!empty($this->phone)) { if (!S::logged()) { @@ -489,7 +489,7 @@ class RefSField extends SField function too_large() { - return ($this->value==''); + return ($this->value == ''); } // }}} @@ -660,7 +660,7 @@ class StringSField extends SField function too_large() { - return ($this->length()<2); + return ($this->length() < 2); } // }}} @@ -846,11 +846,14 @@ class SFieldGroup { $this->fields = $_fields; $this->and = $_and; - foreach ($this->fields as $key=>&$field) { - if (is_null($field)) { - unset($this->fields[$key]); + + $cleanFields = array(); + foreach ($this->fields as $field) { + if (!is_null($field)) { + $cleanFields[] = $field; } } + $this->fields = $cleanFields; } // }}} @@ -859,7 +862,7 @@ class SFieldGroup function too_large() { $b = true; - for ($i=0 ; $b && $ifields) ; $i++) { + for ($i = 0; $b && $i < count($this->fields); ++$i) { if (!is_null($this->fields[$i])) { $b = $b && $this->fields[$i]->too_large(); }