summaryrefslogtreecommitdiff
path: root/install.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-10-04 20:35:16 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-10-04 20:35:16 +0200
commite238607916f294aae6557e5c8ab455ed7b8693de (patch)
treeebef5b49b23491a640bfbbe870a0e2a9e400f060 /install.php
parent01ca51fc428815da0a56df4b053de922df5e390a (diff)
downloadrpg-e238607916f294aae6557e5c8ab455ed7b8693de.tar.gz
rpg-e238607916f294aae6557e5c8ab455ed7b8693de.tar.bz2
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
Diffstat (limited to 'install.php')
-rw-r--r--install.php7
1 files changed, 5 insertions, 2 deletions
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;
}