]> git.mxchange.org Git - friendica.git/commitdiff
Fix Undefined index: Collation in DBStructure
authorHypolite Petovan <mrpetovan@gmail.com>
Tue, 3 Jul 2018 02:28:27 +0000 (22:28 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Tue, 3 Jul 2018 02:28:27 +0000 (22:28 -0400)
src/Database/DBStructure.php

index db6997ec62bd9db7378c5ee8516b2f290e55f20d..dc570f3135edfafc8af958a03c12c05c7a924bdc 100644 (file)
@@ -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"])."'";
                }