Fix _from argument validation

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

@ -101,10 +101,13 @@ 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], '<>'); $from = trim($m[1], '<>');
else }
// ... otherwise it's empty or invalid
else {
$from = null; $from = null;
} }

Loading…
Cancel
Save