diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-27 20:08:38 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-05-01 15:10:08 +0200 |
commit | 25760e30f9859f42885c1d6bc980a3fef8624ee1 (patch) | |
tree | 15720bd1240f0768a6d5c070b62a89d9f07f8470 /include | |
parent | 635b8ff73aca5d1a8ba6ea5bb575f3f2838d41a0 (diff) | |
download | volse-hubzilla-25760e30f9859f42885c1d6bc980a3fef8624ee1.tar.gz volse-hubzilla-25760e30f9859f42885c1d6bc980a3fef8624ee1.tar.bz2 volse-hubzilla-25760e30f9859f42885c1d6bc980a3fef8624ee1.zip |
make mail_store() safe for postgres or mysql5.7 - although this interface needs to be refactored in the future
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index a94805bbc..c895a6d6e 100755 --- a/include/items.php +++ b/include/items.php @@ -3003,8 +3003,14 @@ function mail_store($arr) { $arr['body'] = escape_tags($arr['body']); } - if(array_key_exists('attach',$arr) && is_array($arr['attach'])) - $arr['attach'] = json_encode($arr['attach']); + if(array_key_exists('attach',$arr)) { + if(is_array($arr['attach'])) { + $arr['attach'] = json_encode($arr['attach']); + } + } + else { + $arr['attach'] = ''; + } $arr['account_id'] = ((x($arr,'account_id')) ? intval($arr['account_id']) : 0); $arr['mid'] = ((x($arr,'mid')) ? notags(trim($arr['mid'])) : random_string()); @@ -3015,6 +3021,7 @@ function mail_store($arr) { $arr['title'] = ((x($arr,'title')) ? trim($arr['title']) : ''); $arr['parent_mid'] = ((x($arr,'parent_mid')) ? notags(trim($arr['parent_mid'])) : ''); $arr['body'] = ((x($arr,'body')) ? trim($arr['body']) : ''); + $arr['sig'] = ((x($arr,'sig')) ? trim($arr['sig']) : ''); $arr['conv_guid'] = ((x($arr,'conv_guid')) ? trim($arr['conv_guid']) : ''); $arr['mail_flags'] = ((x($arr,'mail_flags')) ? intval($arr['mail_flags']) : 0 ); |