Skip to content

Commit a577ef2

Browse files
committed
#72: quote database name
1 parent 9c08fdc commit a577ef2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/application/arc/store/ARC2_Store.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ function createDBCon() {
6767
return $this->addError(mysqli_error($db_con));
6868
}
6969
$this->a['db_con'] = $db_con;
70-
if (!mysqli_query( $db_con, "USE " . $this->a['db_name'])) {
70+
if (!mysqli_query( $db_con, "USE `" . $this->a['db_name'] . "`")) {
7171
$fixed = 0;
7272
/* try to create it */
7373
if ($this->a['db_name']) {
7474
$this->queryDB("
75-
CREATE DATABASE IF NOT EXISTS " . $this->a['db_name'] . "
75+
CREATE DATABASE IF NOT EXISTS `" . $this->a['db_name'] . "`
7676
DEFAULT CHARACTER SET utf8
7777
DEFAULT COLLATE utf8_general_ci
7878
", $db_con, 1
7979
);
80-
if (mysqli_query( $db_con, "USE " . $this->a['db_name'])) {
80+
if (mysqli_query( $db_con, "USE `" . $this->a['db_name'] . "`")) {
8181
$this->queryDB("SET NAMES 'utf8'", $db_con);
8282
$fixed = 1;
8383
}

0 commit comments

Comments
 (0)