Commits

Anonymous committed 7f98515

Registration changes for PHP update

  • Participants
  • Parent commits 17a0467

Comments (0)

Files changed (2)

website/account/user.inc

 	}
 
 	// illegal names
-	if (eregi("^((root)|(bin)|(daemon)|(adm)|(lp)|(sync)|(shutdown)|(halt)|(mail)|(news)"
+	if (preg_match("/^((root)|(bin)|(daemon)|(adm)|(lp)|(sync)|(shutdown)|(halt)|(mail)|(news)"
 		. "|(uucp)|(operator)|(games)|(mysql)|(httpd)|(nobody)|(dummy)"
-		. "|(www)|(cvs)|(shell)|(ftp)|(irc)|(debian)|(ns)|(download))$",$name)) {
+		. "|(www)|(cvs)|(shell)|(ftp)|(irc)|(debian)|(ns)|(download))$/i",$name)) {
 		$feedback .= "Name is reserved.";
 		return 0;
 	}
-	if (eregi("^(anoncvs_)",$name)) {
+	if (preg_match("/^(anoncvs_)/i",$name)) {
 		$feedback .= "Name is reserved for CVS.";
 		return false;
 	}
 }
 
 function pw_validate_email ($address) {
-	return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $address));
+    // using > as delimiter as not in string http://uk2.php.net/manual/en/regexp.reference.delimiters.php
+	return (preg_match('>^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$>', $address));
 }
 
 function login_screen()
 <?php
 
-# $Id: db.inc,v 1.32 2011/05/10 17:32:13 publicwhip Exp $
+# $Id: db.inc,v 1.33 2011/06/12 20:44:44 publicwhip Exp $
 # Database access wrapper.  Calls mysql.
 
 # The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
 function isrobot()
 {
     $useragent = $_SERVER["HTTP_USER_AGENT"];
-    return preg_match("(Google|Slurp|msnbot|robot|Gigabot|Teoma|VoilaBot|searchme|ia_archiver|Crawler|MSNBOT|MLBot|Wget|Yandex)", $useragent);
+    return preg_match("/(Google|Slurp|msnbot|robot|Gigabot|Teoma|VoilaBot|searchme|ia_archiver|Crawler|MSNBOT|MLBot|Wget|Yandex)/", $useragent);
 }