From a4eb3ee508804bc1c7c489ea252a9841139e38fb Mon Sep 17 00:00:00 2001
From: Daniel Kesselberg <mail@danielkesselberg.de>
Date: Tue, 25 Sep 2018 21:53:04 +0200
Subject: Validate email in occ command

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
---
 core/Command/Maintenance/Install.php | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'core')

diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php
index 3e6ee2a463f..39692e036ba 100644
--- a/core/Command/Maintenance/Install.php
+++ b/core/Command/Maintenance/Install.php
@@ -171,6 +171,10 @@ class Install extends Command {
 			$adminPassword = $helper->ask($input, $output, $question);
 		}
 
+		if ($adminEmail !== null && !filter_var($adminEmail, FILTER_VALIDATE_EMAIL)) {
+			throw new InvalidArgumentException('Invalid e-mail-address <' . $adminEmail . '> for <' . $adminLogin . '>.');
+		}
+
 		$options = [
 			'dbtype' => $db,
 			'dbuser' => $dbUser,
-- 
cgit v1.2.3