Replace more is_null with empty in DBStructure

This commit is contained in:
Hypolite Petovan 2018-07-02 22:42:15 -04:00
parent e7d6b48bb3
commit 79ff49d716
1 changed files with 4 additions and 4 deletions

View File

@ -413,7 +413,7 @@ class DBStructure
$field_definition = $database[$name]["fields"][$fieldname]; $field_definition = $database[$name]["fields"][$fieldname];
// Define the default collation if not given // Define the default collation if not given
if (!isset($parameters['Collation']) && !is_null($field_definition['Collation'])) { if (!isset($parameters['Collation']) && !empty($field_definition['Collation'])) {
$parameters['Collation'] = 'utf8mb4_general_ci'; $parameters['Collation'] = 'utf8mb4_general_ci';
} else { } else {
$parameters['Collation'] = null; $parameters['Collation'] = null;
@ -580,7 +580,7 @@ class DBStructure
} }
} }
if (!is_null($structure["indexes"])) { if (!empty($structure["indexes"])) {
foreach ($structure["indexes"] AS $indexname => $fieldnames) { foreach ($structure["indexes"] AS $indexname => $fieldnames) {
$sql_index = self::createIndex($indexname, $fieldnames, ""); $sql_index = self::createIndex($indexname, $fieldnames, "");
if (!is_null($sql_index)) { if (!is_null($sql_index)) {
@ -589,11 +589,11 @@ class DBStructure
} }
} }
if (!is_null($structure["engine"])) { if (!empty($structure["engine"])) {
$engine = " ENGINE=" . $structure["engine"]; $engine = " ENGINE=" . $structure["engine"];
} }
if (!is_null($structure["comment"])) { if (!empty($structure["comment"])) {
$comment = " COMMENT='" . dbesc($structure["comment"]) . "'"; $comment = " COMMENT='" . dbesc($structure["comment"]) . "'";
} }