Skip to content

Commit

Permalink
Fix some potential bugs after my last commit
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed May 19, 2020
1 parent 3db0332 commit cfc17e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libraries/classes/Common.php
Expand Up @@ -118,7 +118,7 @@ public static function database(): void
if (isset($_POST['submitcollation'], $_POST['db_collation']) && ! empty($_POST['db_collation'])) {
[$db_charset] = explode('_', $_POST['db_collation']);
$sql_query = 'ALTER DATABASE ' . Util::backquote($db)
. ' DEFAULT' . Util::getCharsetQueryPart($_POST['db_collation']);
. ' DEFAULT' . Util::getCharsetQueryPart($_POST['db_collation'] ?? '');
$dbi->query($sql_query);
$message = Message::success();

Expand All @@ -140,7 +140,7 @@ public static function database(): void
. '.'
. Util::backquote($tableName)
. ' DEFAULT '
. Util::getCharsetQueryPart($_POST['db_collation']);
. Util::getCharsetQueryPart($_POST['db_collation'] ?? '');
$dbi->query($sql_query);

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/CreateAddField.php
Expand Up @@ -462,7 +462,7 @@ public function getTableCreationQuery(string $db, string $table): string
$sqlQuery .= ' ENGINE = ' . $this->dbi->escapeString($_POST['tbl_storage_engine']);
}
if (! empty($_POST['tbl_collation'])) {
$sqlQuery .= Util::getCharsetQueryPart($_POST['tbl_collation']);
$sqlQuery .= Util::getCharsetQueryPart($_POST['tbl_collation'] ?? '');
}
if (! empty($_POST['connection'])
&& ! empty($_POST['tbl_storage_engine'])
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Operations.php
Expand Up @@ -102,7 +102,7 @@ public function createDbBeforeCopy()
. Util::backquote($_POST['newname']);
if (isset($_POST['db_collation'])) {
$local_query .= ' DEFAULT'
. Util::getCharsetQueryPart($_POST['db_collation']);
. Util::getCharsetQueryPart($_POST['db_collation'] ?? '');
}
$local_query .= ';';
$GLOBALS['sql_query'] .= $local_query;
Expand Down Expand Up @@ -842,7 +842,7 @@ public function getTableAltersArray(
&& $_POST['tbl_collation'] !== $tbl_collation
) {
$table_alters[] = 'DEFAULT '
. Util::getCharsetQueryPart($_POST['tbl_collation']);
. Util::getCharsetQueryPart($_POST['tbl_collation'] ?? '');
}

if ($pma_table->isEngine(['MYISAM', 'ARIA', 'ISAM'])
Expand Down

0 comments on commit cfc17e5

Please sign in to comment.