aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-03-04 14:30:09 -0800
committerMario Vavti <mario@mariovavti.com>2018-03-05 08:57:23 +0100
commit77a8a2b9ac999eede28169420fb44ada95fa4644 (patch)
tree08511fd93fc74dfee29460ea1b1cd2b27fb3a9dc /include
parent09b6888526f30876d402e456da9fde92ba326f26 (diff)
downloadvolse-hubzilla-77a8a2b9ac999eede28169420fb44ada95fa4644.tar.gz
volse-hubzilla-77a8a2b9ac999eede28169420fb44ada95fa4644.tar.bz2
volse-hubzilla-77a8a2b9ac999eede28169420fb44ada95fa4644.zip
restrict mail messages to max_import_size
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php7
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) : '');