From e238607916f294aae6557e5c8ab455ed7b8693de Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 4 Oct 2006 20:35:16 +0200 Subject: better datachecking in install.php This patch automatically lowercases the superuser name like DokuWiki will do itself later on. It also fixes the email check and requires it to have at least an @ character. darcs-hash:20061004183516-7ad00-791df13131c2484cb08c840812688d83bdf807fa.gz --- install.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index 243b319b4..7b1608b7a 100644 --- a/install.php +++ b/install.php @@ -212,10 +212,13 @@ function print_retry() { * * @author Andreas Gohr */ -function check_data($d){ +function check_data(&$d){ global $lang; global $error; + //autolowercase the username + $d['superuser'] = strtolower($d['superuser']); + $ok = true; // check input @@ -240,7 +243,7 @@ function check_data($d){ $error[] = sprintf($lang['i_badval'],$lang['fullname']); $ok = false; } - if(empty($d['email']) || strstr($d['fullname'],':')){ + if(empty($d['email']) || strstr($d['email'],':') || !strstr($d['email'],'@')){ $error[] = sprintf($lang['i_badval'],$lang['email']); $ok = false; } -- cgit v1.2.3