diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-13 00:30:41 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-13 00:30:41 -0700 |
commit | 6532972e61a2aa5e8517ebcca3113adb3c8f336d (patch) | |
tree | 1bb8dba43eee1c57746987aee05814d135235a2f /include/text.php | |
parent | 48026efddfdf063fad7c7bd7a86dd7fc4ca4a0a7 (diff) | |
download | volse-hubzilla-6532972e61a2aa5e8517ebcca3113adb3c8f336d.tar.gz volse-hubzilla-6532972e61a2aa5e8517ebcca3113adb3c8f336d.tar.bz2 volse-hubzilla-6532972e61a2aa5e8517ebcca3113adb3c8f336d.zip |
additional array checking
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php index f23458db0..fcd5dbc0c 100644 --- a/include/text.php +++ b/include/text.php @@ -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; }
\ No newline at end of file |