mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Enable support of databases which name either is a reserved word or contains non-alphanumeric characters (i.e. itop-production).
SVN:trunk[2595]
This commit is contained in:
@@ -64,7 +64,7 @@ class CMDBSource
|
|||||||
}
|
}
|
||||||
if (!empty($sSource))
|
if (!empty($sSource))
|
||||||
{
|
{
|
||||||
if (!((bool)mysqli_query(self::$m_resDBLink, "USE $sSource")))
|
if (!((bool)mysqli_query(self::$m_resDBLink, "USE `$sSource`")))
|
||||||
{
|
{
|
||||||
throw new MySQLException('Could not select DB', array('host'=>$sServer, 'user'=>$sUser, 'db_name'=>$sSource));
|
throw new MySQLException('Could not select DB', array('host'=>$sServer, 'user'=>$sUser, 'db_name'=>$sSource));
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ class CMDBSource
|
|||||||
{
|
{
|
||||||
// In case we don't have rights to enumerate the databases
|
// In case we don't have rights to enumerate the databases
|
||||||
// Let's try to connect directly
|
// Let's try to connect directly
|
||||||
return @((bool)mysqli_query(self::$m_resDBLink, "USE $sSource"));
|
return @((bool)mysqli_query(self::$m_resDBLink, "USE `$sSource`"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ class CMDBSource
|
|||||||
|
|
||||||
public static function SelectDB($sSource)
|
public static function SelectDB($sSource)
|
||||||
{
|
{
|
||||||
if (!((bool)mysqli_query(self::$m_resDBLink, "USE $sSource")))
|
if (!((bool)mysqli_query(self::$m_resDBLink, "USE `$sSource`")))
|
||||||
{
|
{
|
||||||
throw new MySQLException('Could not select DB', array('db_name'=>$sSource));
|
throw new MySQLException('Could not select DB', array('db_name'=>$sSource));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user