mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-12 20:41:26 +01:00
Fix: Ajout test si paramtre host invalide
This commit is contained in:
@@ -84,15 +84,21 @@ class DoliDb
|
||||
global $conf;
|
||||
$this->transaction_opened=0;
|
||||
|
||||
if ($host == '') $host = $conf->db->host;
|
||||
if ($user == '') $user = $conf->db->user;
|
||||
if ($pass == '') $pass = $conf->db->pass;
|
||||
if ($name == '') $name = $conf->db->name;
|
||||
if (! $host) $host = $conf->db->host;
|
||||
if (! $user) $user = $conf->db->user;
|
||||
if (! $pass) $pass = $conf->db->pass;
|
||||
if (! $name) $name = $conf->db->name;
|
||||
|
||||
//print "Name DB: $host,$user,$pass,$name<br>";
|
||||
|
||||
if (! $host)
|
||||
{
|
||||
$this->connected = 0;
|
||||
$this->ok = 0;
|
||||
dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters");
|
||||
return $this->ok;
|
||||
}
|
||||
|
||||
// Essai connexion serveur
|
||||
|
||||
$this->db = $this->connect($host, $user, $pass, $newlink);
|
||||
|
||||
if ($this->db)
|
||||
@@ -108,7 +114,6 @@ class DoliDb
|
||||
}
|
||||
|
||||
// Si connexion serveur ok et si connexion base demand<6E>e, on essaie connexion base
|
||||
|
||||
if ($this->connected && $name)
|
||||
{
|
||||
if ($this->select_db($name) == 1)
|
||||
|
||||
Reference in New Issue
Block a user