Merge pull request #23670 from Daviid-P/fix_database_backtick

Encase database name in backticks
This commit is contained in:
Laurent Destailleur 2023-01-29 20:49:47 +01:00 committed by GitHub
commit 84934046b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {