diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-06-05 10:36:37 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-06-05 10:36:37 +0200 |
commit | 30c00df4f324b0934861195e1f04e36063ef3590 (patch) | |
tree | 2bfeefa16655781f89bbab1507e713cd70248e90 /include/import.php | |
parent | 6019a34da2184519bc535fa771b30695d9580b92 (diff) | |
parent | e1b85a361cf53fd7bb79ef24d9d5b0dfb145fccf (diff) | |
download | volse-hubzilla-30c00df4f324b0934861195e1f04e36063ef3590.tar.gz volse-hubzilla-30c00df4f324b0934861195e1f04e36063ef3590.tar.bz2 volse-hubzilla-30c00df4f324b0934861195e1f04e36063ef3590.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/import.php')
-rw-r--r-- | include/import.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/import.php b/include/import.php index ae6a0ab6a..91a26b23b 100644 --- a/include/import.php +++ b/include/import.php @@ -1326,20 +1326,23 @@ function sync_files($channel, $files) { ); if($exists) { - if(! dbesc_array($p)) - continue; $str = ''; foreach($p as $k => $v) { + $matches = false; + if(preg_match('/([^a-zA-Z0-9\-\_\.])/',$k,$matches)) { + continue; + } + if($str) $str .= ","; - - $str .= " " . TQUOT . $k . TQUOT . " = '" . $v . "' "; + + $str .= " " . TQUOT . $k . TQUOT . " = '" . (($k === 'content') ? dbescbin($v) : dbesc($v)) . "' "; } $r = dbq("update photo set " . $str . " where id = " . intval($exists[0]['id']) ); } else { - create_table_from_array('photo',$p); + create_table_from_array('photo',$p, [ 'content' ] ); } } } |