aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-04-27 20:08:38 -0700
committerzotlabs <mike@macgirvin.com>2017-04-27 20:08:38 -0700
commit89e7e5e4fbafa9bac7263513315f89cfe7ac02fb (patch)
treee15b71264cd8e7b54c7601e1c76bbe536345f2f7 /include
parente8ea8d203db5bdf62995f1831b1503ac11556435 (diff)
downloadvolse-hubzilla-89e7e5e4fbafa9bac7263513315f89cfe7ac02fb.tar.gz
volse-hubzilla-89e7e5e4fbafa9bac7263513315f89cfe7ac02fb.tar.bz2
volse-hubzilla-89e7e5e4fbafa9bac7263513315f89cfe7ac02fb.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-xinclude/items.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 7cad3b168..30aa30048 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2945,8 +2945,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());
@@ -2957,6 +2963,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_mimetype'] = ((x($arr,'mail_mimetype')) ? trim($arr['mail_mimetype']) : 'text/bbcode');