From: Hypolite Petovan Date: Tue, 3 Jul 2018 02:28:27 +0000 (-0400) Subject: Fix Undefined index: Collation in DBStructure X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e7d6b48bb334df22349934c374827352b2801094;p=friendica.git Fix Undefined index: Collation in DBStructure --- diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index db6997ec62..dc570f3135 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -537,26 +537,26 @@ class DBStructure private static function FieldCommand($parameters, $create = true) { $fieldstruct = $parameters["type"]; - if (!is_null($parameters["Collation"])) { + if (!empty($parameters["Collation"])) { $fieldstruct .= " COLLATE ".$parameters["Collation"]; } - if ($parameters["not null"]) { + if (!empty($parameters["not null"])) { $fieldstruct .= " NOT NULL"; } - if (isset($parameters["default"])) { + if (!empty($parameters["default"])) { if (strpos(strtolower($parameters["type"]),"int")!==false) { $fieldstruct .= " DEFAULT ".$parameters["default"]; } else { $fieldstruct .= " DEFAULT '".$parameters["default"]."'"; } } - if ($parameters["extra"] != "") { + if (!empty($parameters["extra"])) { $fieldstruct .= " ".$parameters["extra"]; } - if (!is_null($parameters["comment"])) { + if (!empty($parameters["comment"])) { $fieldstruct .= " COMMENT '".dbesc($parameters["comment"])."'"; }