some minimal test
authorx2000habouzit <x2000habouzit>
Mon, 25 Oct 2004 20:27:52 +0000 (20:27 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 25 Oct 2004 20:27:52 +0000 (20:27 +0000)
htdocs/search.php

index 1c030f4..0168a87 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.php,v 1.35 2004-10-25 12:48:02 x2000habouzit Exp $
+        $Id: search.php,v 1.36 2004-10-25 20:27:52 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -53,6 +53,12 @@ if (array_key_exists('rechercher', $_REQUEST)) {
     $womanField = new RefSField('woman',array('FIND_IN_SET(i.flags,\'femme\')+1'),'','','');
     $fields = new SFieldGroup(true,array($nameField,$firstnameField,$promo1Field,$promo2Field,$womanField));
     
+    if (!$nameField->length() && !$firstnameField->length()
+       && empty($_REQUEST['promo1']) && empty($_REQUEST['promo2'])
+       && !$_REQUEST['woman'])
+    {
+       new ThrowError('Recherche trop générale.');
+    }
     $offset = new NumericSField('offset');
    
     $sql = 'SELECT SQL_CALC_FOUND_ROWS