additional array checking

This commit is contained in:
zotlabs
2016-10-13 00:30:41 -07:00
parent 48026efddf
commit 6532972e61
5 changed files with 27 additions and 14 deletions

View File

@@ -3035,13 +3035,14 @@ function create_table_from_array($table,$arr) {
if(! ($arr && $table))
return false;
dbesc_array($arr);
$r = dbq("INSERT INTO " . TQUOT . $table . TQUOT . " (" . TQUOT
if(dbesc_array($arr)) {
$r = dbq("INSERT INTO " . TQUOT . $table . TQUOT . " (" . TQUOT
. implode(TQUOT . ', ' . TQUOT, array_keys($arr))
. TQUOT . ") VALUES ('"
. implode("', '", array_values($arr))
. "')" );
. "')"
);
}
return $r;
}