aboutsummaryrefslogtreecommitdiffstats
path: root/include/email.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-18 17:16:02 -0700
committerFriendika <info@friendika.com>2011-09-18 17:16:02 -0700
commite2e29b2deafffb98d156fb3f726a3968b3492522 (patch)
treeb039924fa3bd84999177e70fbd52b9f67baa6fdf /include/email.php
parent5899c9f406eb52c41c6b4ff87b0b313c26786cfe (diff)
downloadvolse-hubzilla-e2e29b2deafffb98d156fb3f726a3968b3492522.tar.gz
volse-hubzilla-e2e29b2deafffb98d156fb3f726a3968b3492522.tar.bz2
volse-hubzilla-e2e29b2deafffb98d156fb3f726a3968b3492522.zip
only header encode if necessary
Diffstat (limited to 'include/email.php')
-rw-r--r--include/email.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/email.php b/include/email.php
index b34084549..3e6a8186d 100644
--- a/include/email.php
+++ b/include/email.php
@@ -169,6 +169,17 @@ function email_get_part($mbox,$uid,$p,$partno) {
function email_header_encode($in_str, $charset) {
$out_str = $in_str;
+ $need_to_convert = false;
+
+ for($x = 0; $x < strlen($in_str); $x ++) {
+ if((ord($in_str[$x]) == 0) || ((ord($in_str[$x]) > 128))) {
+ $need_to_convert = true;
+ }
+ }
+
+ if(! $need_to_convert)
+ return $in_str;
+
if ($out_str && $charset) {
// define start delimimter, end delimiter and spacer