Fix handling of 'mailto' and 'error' arguments in message_before_send hook (#5347)

Conflicts:
	program/lib/Roundcube/rcube.php
pull/5754/head
Aleksander Machniak 8 years ago
parent 28090d38c1
commit a1e23a8967

@ -25,6 +25,7 @@ CHANGELOG Roundcube Webmail
- Fix conflict in new_user_dialog and password_force_new_user settings (#5275)
- Don't create multipart/alternative messages with empty text/plain part (#5283)
- Use contact_search_name format in popup on results in compose contacts search
- Fix handling of 'mailto' and 'error' arguments in message_before_send hook (#5347)
RELEASE 1.2.0
-------------

@ -1602,10 +1602,14 @@ class rcube
// unset To,Subject headers because they will be added by the mail() function
$header_str = $this->message_head($message, array('To', 'Subject'));
if (is_array($mailto)) {
$mailto = implode(', ', $mailto);
}
// #1485779
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if (preg_match_all('/<([^@]+@[^>]+)>/', $headers['To'], $m)) {
$headers['To'] = implode(', ', $m[1]);
if (preg_match_all('/<([^@]+@[^>]+)>/', $mailto, $m)) {
$mailto = implode(', ', $m[1]);
}
}
@ -1618,9 +1622,9 @@ class rcube
true, false);
}
else {
$delim = $this->config->header_delimiter();
$to = $headers['To'];
$subject = $headers['Subject'];
$delim = $this->config->header_delimiter();
$to = $mailto;
$subject = $headers['Subject'];
$header_str = rtrim($header_str);
if ($delim != "\r\n") {

@ -540,10 +540,16 @@ if (!$savedraft && !$saveonly) {
unlink($mailbody_file);
}
if ($smtp_error)
$OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
else
$OUTPUT->show_message('sendingfailed', 'error');
if ($smtp_error && is_string($smtp_error)) {
$OUTPUT->show_message($smtp_error, 'error');
}
else if ($smtp_error && !empty($smtp_error['label'])) {
$OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
}
else {
$OUTPUT->show_message('sendingfailed', 'error');
}
$OUTPUT->send('iframe');
}

Loading…
Cancel
Save