X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch%2Fclasses.inc.php;h=d232f11cb2d69744460e9c10b8e400b1e3d7bb20;hb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;hp=569f040ad2b9da0c21bcb498f6f16d5b8181e159;hpb=833a6e86ea17d40444ae32cd6c92b9359f383e71;p=platal.git diff --git a/modules/search/classes.inc.php b/modules/search/classes.inc.php index 569f040..d232f11 100644 --- a/modules/search/classes.inc.php +++ b/modules/search/classes.inc.php @@ -1,6 +1,6 @@ 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(); }