Encase database name in backticks

This commit is contained in:
David Pareja Rodriguez 2023-01-24 10:54:48 +01:00
parent c2b9f05fe8
commit 7f6d993040

View File

@ -678,7 +678,7 @@ class DoliDBMysqli extends DoliDB
} }
$tmpdatabase = preg_replace('/[^a-z0-9\.\-\_]/i', '', $database); $tmpdatabase = preg_replace('/[^a-z0-9\.\-\_]/i', '', $database);
$sql = "SHOW TABLES FROM ".$tmpdatabase." ".$like.";"; $sql = "SHOW TABLES FROM `".$tmpdatabase."` ".$like.";";
//print $sql; //print $sql;
$result = $this->query($sql); $result = $this->query($sql);
if ($result) { if ($result) {