diff --git a/htdocs/societe.php b/htdocs/societe.php index 0f4b0a205e0..7370904f24a 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -68,17 +67,17 @@ $modesearch=isset($_GET["mode-search"])?$_GET["mode-search"]:$_POST["mode-search if ($mode == 'search') { - $_POST["search_nom"]="$socname"; + $_POST["search_nom"]=$socname; $sql = "SELECT s.rowid"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ("; - $sql.= "s.nom like '%".$socname."%'"; - $sql.= " OR s.code_client LIKE '%".$socname."%'"; - $sql.= " OR s.email like '%".$socname."%'"; - $sql.= " OR s.url like '%".$socname."%'"; + $sql.= "s.nom like '%".addslashes($socname)."%'"; + $sql.= " OR s.code_client LIKE '%".addslashes($socname)."%'"; + $sql.= " OR s.email like '%".addslashes($socname)."%'"; + $sql.= " OR s.url like '%".addslashes($socname)."%'"; $sql.= ")"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -89,7 +88,7 @@ if ($mode == 'search') { $obj = $db->fetch_object($result); $socid = $obj->rowid; - header("Location: soc.php?socid=".$socid.""); + header("Location: ".DOL_URL_ROOT."/soc.php?socid=".$socid); exit; } $db->free($result); @@ -221,19 +220,19 @@ if ($result) $obj = $db->fetch_object(); $var=!$var; print ""; - print "rowid."\">"; + print "rowid."\">"; print img_object($langs->trans("ShowCompany"),"company"); - print " rowid."\">".stripslashes($obj->nom)."\n"; + print " rowid."\">".$obj->nom."\n"; print "".$obj->ville." \n"; print "".$obj->siren." \n"; print ''; if ($obj->client==1) { - print "rowid."\">".$langs->trans("Customer")."\n"; + print "rowid."\">".$langs->trans("Customer")."\n"; } elseif ($obj->client==2) { - print "rowid."\">".$langs->trans("Prospect")."\n"; + print "rowid."\">".$langs->trans("Prospect")."\n"; } else {