| | |
| | | // #1486037: remove "mailto:" prefix |
| | | $COMPOSE['param']['to'] = preg_replace('/^mailto:/i', '', $mailto[0]); |
| | | // #1490346: decode the recipient address |
| | | $COMPOSE['param']['to'] = urldecode($COMPOSE['param']['to']); |
| | | // #1490510: use raw encoding for correct "+" character handling as specified in RFC6068 |
| | | $COMPOSE['param']['to'] = rawurldecode($COMPOSE['param']['to']); |
| | | |
| | | // Supported case-insensitive tokens in mailto URL |
| | | $url_tokens = array('to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'body'); |
| | |
| | | $text = $html = $sql_arr['signature']; |
| | | |
| | | if ($sql_arr['html_signature']) { |
| | | $h2t = new rcube_html2text($html, false, true); |
| | | $text = trim($h2t->get_text()); |
| | | $text = $RCMAIL->html2text($html); |
| | | } |
| | | else { |
| | | $t2h = new rcube_text2html($text, false); |
| | |
| | | if ($part->ctype_secondary == 'html') { |
| | | // use html part if it has been used for message (pre)viewing |
| | | // decrease line length for quoting |
| | | $len = $COMPOSE['mode'] == RCUBE_COMPOSE_REPLY ? $LINE_LENGTH-2 : $LINE_LENGTH; |
| | | $txt = new rcube_html2text($body, false, true, $len); |
| | | $body = $txt->get_text(); |
| | | $len = $COMPOSE['mode'] == RCUBE_COMPOSE_REPLY ? $LINE_LENGTH-2 : $LINE_LENGTH; |
| | | $body = $RCMAIL->html2text($body, array('width' => $len)); |
| | | } |
| | | else { |
| | | if ($part->ctype_secondary == 'plain' && $part->ctype_parameters['format'] == 'flowed') { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Creates reply subject by removing common subject |
| | | * prefixes/suffixes from the original message subject |
| | | */ |
| | | function rcmail_reply_subject($subject) |
| | | { |
| | | $subject = trim($subject); |
| | | |
| | | // replace Re:, Re[x]:, Re-x (#1490497) |
| | | $prefix = '/^(re:|re\[\d\]:|re-\d:)\s*/i'; |
| | | do { |
| | | $subject = preg_replace($prefix, '', $subject, -1, $count); |
| | | } |
| | | while ($count); |
| | | |
| | | // replace (was: ...) (#1489375) |
| | | $subject = preg_replace('/\s*\([wW]as:[^\)]+\)\s*$/', '', $subject); |
| | | |
| | | return 'Re: ' . $subject; |
| | | } |
| | | |
| | | function rcmail_compose_subject($attrib) |
| | | { |
| | | global $MESSAGE, $COMPOSE; |
| | |
| | | } |
| | | // create a reply-subject |
| | | else if ($COMPOSE['mode'] == RCUBE_COMPOSE_REPLY) { |
| | | if (preg_match('/^re:/i', $MESSAGE->subject)) |
| | | $subject = $MESSAGE->subject; |
| | | else |
| | | $subject = 'Re: '.$MESSAGE->subject; |
| | | |
| | | // replace (was: ...) (#1489375) |
| | | $subject = preg_replace('/\s*\([wW]as:[^\)]+\)\s*$/', '', $subject); |
| | | $subject = rcmail_reply_subject($MESSAGE->subject); |
| | | } |
| | | // create a forward-subject |
| | | else if ($COMPOSE['mode'] == RCUBE_COMPOSE_FORWARD) { |
| | |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | function rcmail_compose_attachment_list($attrib) |
| | | { |