Skip to content

Commit

Permalink
Attempt at fixing sonarcube issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Nov 25, 2024
1 parent e128473 commit 5e76cf4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,13 @@ public function __construct($dbh)
if ($databasename === '' && $newdatabasename !== '') {
// create new db
$databasename = $link->real_escape_string($newdatabasename);
$query = $link->prepare('CREATE DATABASE IF NOT EXISTS ?');
$query->execute([$databasename]);
$db_result = $query->fetch();

if (
!$link->select_db($databasename)
&& !$link->query("CREATE DATABASE IF NOT EXISTS `" . $databasename . "`;")
&& !$db_result
) {
echo __s('Error in creating database!');
echo "<br>" . sprintf(__s('The server answered: %s'), htmlescape($link->error));
Expand Down

0 comments on commit 5e76cf4

Please sign in to comment.