prep.statement cannot be used for create database query; regex-validate database_name

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2021-10-11 18:55:15 +02:00
parent eb592340b0
commit 5009c625d8
2 changed files with 2 additions and 5 deletions

View File

@@ -60,10 +60,7 @@ class DbManagerMySQL
*/
public function createDatabase($dbname = null)
{
$stmt = Database::prepare("CREATE DATABASE :dbname");
Database::pexecute($stmt, [
'dbname' => $dbname
]);
Database::query("CREATE DATABASE `" . Database::quote($dbname) . "`");
}
/**