diff options
author | zotlabs <mike@macgirvin.com> | 2018-03-04 14:30:09 -0800 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-03-05 08:57:23 +0100 |
commit | 77a8a2b9ac999eede28169420fb44ada95fa4644 (patch) | |
tree | 08511fd93fc74dfee29460ea1b1cd2b27fb3a9dc | |
parent | 09b6888526f30876d402e456da9fde92ba326f26 (diff) | |
download | volse-hubzilla-77a8a2b9ac999eede28169420fb44ada95fa4644.tar.gz volse-hubzilla-77a8a2b9ac999eede28169420fb44ada95fa4644.tar.bz2 volse-hubzilla-77a8a2b9ac999eede28169420fb44ada95fa4644.zip |
restrict mail messages to max_import_size
-rwxr-xr-x | include/items.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index 790b91c88..50f663836 100755 --- a/include/items.php +++ b/include/items.php @@ -1412,6 +1412,13 @@ function get_mail_elements($x) { } else { $arr['body'] = (($x['body']) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8',false) : ''); + + $maxlen = get_max_import_size(); + + if($maxlen && mb_strlen($arr['body']) > $maxlen) { + $arr['body'] = mb_substr($arr['body'],0,$maxlen,'UTF-8'); + logger('message length exceeds max_import_size: truncated'); + } } $arr['title'] = (($x['title'])? htmlspecialchars($x['title'],ENT_COMPAT,'UTF-8',false) : ''); |