trim email address when added as forwarder, fixes #591

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-11-23 09:03:27 +01:00
parent 3a3b35b2eb
commit 1d3d8d0f28
2 changed files with 78 additions and 41 deletions

View File

@@ -63,6 +63,9 @@ class EmailForwarders extends ApiCommand implements ResourceEntity
// current destination array
$result['destination_array'] = explode(' ', $result['destination']);
// prepare destination
$destination = trim($destination);
if (! validateEmail($destination)) {
standard_error('destinationiswrong', $destination, true);
} elseif ($destination == $result['email']) {