diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2018-09-25 21:53:04 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-02 22:24:30 +0200 |
commit | a4eb3ee508804bc1c7c489ea252a9841139e38fb (patch) | |
tree | 165f8a09649081a551328e9481075ad5a00244e0 /core/Command/Maintenance/Install.php | |
parent | 13877c2d2068189cff180ea8f4f62826afda6414 (diff) | |
download | nextcloud-server-a4eb3ee508804bc1c7c489ea252a9841139e38fb.tar.gz nextcloud-server-a4eb3ee508804bc1c7c489ea252a9841139e38fb.zip |
Validate email in occ command
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core/Command/Maintenance/Install.php')
-rw-r--r-- | core/Command/Maintenance/Install.php | 4 |
1 files changed, 4 insertions, 0 deletions
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, |