From a80a67fd052209e089d21e6d255976df73470233 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Aug 2004 21:27:44 +0000 Subject: [PATCH] Fix: register_globals=off --- htdocs/contact/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 003cd66bb16..001d72d3d22 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -1,6 +1,7 @@ - * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +35,7 @@ if ($user->societe_id > 0) llxHeader(); +$contactname=isset($_GET["contactname"])?$_GET["contactname"]:$_POST["contactname"]; $page = $_GET["page"]; $sortfield = $_GET["sortfield"]; $sortorder = $_GET["sortorder"]; @@ -57,6 +59,7 @@ if ($_GET["view"] == 'recent') { $text="(R $titre = "Liste des contacts $text"; + /* * * Mode liste @@ -79,11 +82,9 @@ if (strlen($_GET["begin"])) // filtre sur la premiere lettre du nom $sql .= " WHERE upper(p.name) like '".$_GET["begin"]."%'"; } -if (strlen($_GET["contactname"]) && $_GET["mode"] == "search") // acces a partir du module de recherche +if ($contactname) { - $sql .= " WHERE ( lower(p.name) like '%".strtolower($_GET["contactname"])."%' OR lower(p.firstname) like '%".strtolower($_GET["contactname"])."%') "; - $sortfield = "lower(p.name)"; - $sortorder = "ASC"; + $sql .= " WHERE (p.name like '%".$contactname."%' OR p.firstname like '%".$contactname."%') "; } if ($socid)