Browse Source

Fix _from argument validation

pull/6833/head
Aleksander Machniak 9 years ago
parent
commit
aa6bf38843
  1. 13
      program/steps/mail/sendmail.inc

13
program/steps/mail/sendmail.inc

@ -106,11 +106,14 @@ if (is_numeric($from)) {
} }
} }
// ... if there is no identity record, this might be a custom from // ... if there is no identity record, this might be a custom from
else if ($from_string = rcmail_email_input_format($from)) {
if (preg_match('/(\S+@\S+)/', $from_string, $m))
$from = trim($m[1], '<>');
else
$from = null;
else if (($from_string = rcmail_email_input_format($from))
&& preg_match('/(\S+@\S+)/', $from_string, $m)
) {
$from = trim($m[1], '<>');
}
// ... otherwise it's empty or invalid
else {
$from = null;
} }
if (!$from_string && $from) { if (!$from_string && $from) {

Loading…
Cancel
Save