diff options
author | Andrew Manning <tamanning@zoho.com> | 2017-05-03 20:44:54 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2017-05-03 20:44:54 -0400 |
commit | 06d2d31777d0ab205c1f2a0258acfbc0462c9a60 (patch) | |
tree | 28b03be55fdab2e1094831af7cf6f320324dc925 /include/message.php | |
parent | e99be61d4995bece3c7af703b22ebe1be149a7fd (diff) | |
parent | d6a3f7765adbbf5f58c08964932d25d3c0364439 (diff) | |
download | volse-hubzilla-06d2d31777d0ab205c1f2a0258acfbc0462c9a60.tar.gz volse-hubzilla-06d2d31777d0ab205c1f2a0258acfbc0462c9a60.tar.bz2 volse-hubzilla-06d2d31777d0ab205c1f2a0258acfbc0462c9a60.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include/message.php')
-rw-r--r-- | include/message.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/message.php b/include/message.php index e7db98d7e..b56f98238 100644 --- a/include/message.php +++ b/include/message.php @@ -35,13 +35,15 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep $body = cleanup_bbcode($body); $results = linkify_tags($a, $body, $uid); - - if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match)) - $attaches = $match[1]; + if(! $raw) { + if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match)) { + $attaches = $match[1]; + } + } $attachments = ''; - if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { + if((! $raw) && preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { $attachments = array(); foreach($match[2] as $mtch) { $hash = substr($mtch,0,strpos($mtch,',')); @@ -184,7 +186,7 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep if($subject) $subject = str_rot47(base64url_encode($subject)); - if($body) + if(($body )&& (! $raw)) $body = str_rot47(base64url_encode($body)); $sig = ''; // placeholder @@ -514,6 +516,9 @@ function private_messages_fetch_conversation($channel_id, $messageitem_id, $upda if($messages[$k]['body']) $messages[$k]['body'] = base64url_decode(str_rot47($messages[$k]['body'])); } + if($messages[$k]['mail_raw']) + $messages[$k]['body'] = mail_prepare_binary([ 'id' => $messages[$k]['id'] ]); + } |