Fix _from argument validation

pull/5754/head
Aleksander Machniak 8 years ago
parent 2441456597
commit 6fa88c9814

@ -101,11 +101,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)) { else if (($from_string = rcmail_email_input_format($from))
if (preg_match('/(\S+@\S+)/', $from_string, $m)) && preg_match('/(\S+@\S+)/', $from_string, $m)
$from = trim($m[1], '<>'); ) {
else $from = trim($m[1], '<>');
$from = null; }
// ... otherwise it's empty or invalid
else {
$from = null;
} }
// check 'From' address (identity may be incomplete) // check 'From' address (identity may be incomplete)

Loading…
Cancel
Save