diff --git a/includes/mysql_functions.php b/includes/mysql_functions.php index 86b7ec0..2c3f213 100644 --- a/includes/mysql_functions.php +++ b/includes/mysql_functions.php @@ -11,6 +11,7 @@ function dbconnect($dbhost, $dbuser, $dbpass, $dbname ) { die(_FATALERROR." "._NOTCONNECTED); } mysql_select_db($dbname, $mysql_access); + mysql_query("SET SESSION sql_mode = 'MYSQL40'"); return $mysql_access; } diff --git a/includes/mysqli_functions.php b/includes/mysqli_functions.php index ad5689d..b4a9a8a 100644 --- a/includes/mysqli_functions.php +++ b/includes/mysqli_functions.php @@ -9,6 +9,7 @@ function dbconnect($dbhost, $dbuser, $dbpass, $dbname ) { include(_BASEDIR."languages/en.php"); // Because we haven't got a language set yet. die(_FATALERROR." "._NOTCONNECTED); } + mysqli_query($mysql_access, "SET SESSION sql_mode = 'MYSQL40'"); return $mysql_access; } diff --git a/install/install.php b/install/install.php index 05711e1..a647d8a 100644 --- a/install/install.php +++ b/install/install.php @@ -152,7 +152,7 @@ function random_string ($charset_string, $length) $penname = descript($_POST['newpenname']); if((!$_POST['email']) && !isADMIN) $fail .= "
"._EMAILREQUIRED." "._TRYAGAIN."
"; if($penname && !preg_match("!^[a-z0-9_ ]{3,30}$!i", $penname)) $fail = "
"._BADUSERNAME." "._TRYAGAIN."
"; - if(!preg_match("/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+/i", $_POST[email])) $fail = "
"._INVALIDEMAIL." "._TRYAGAIN."
"; + if(!preg_match("/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/", $_POST[email])) $fail = "
"._INVALIDEMAIL." "._TRYAGAIN."
"; if($_POST['password'] == $_POST['password2']) $encryptpassword = md5($_POST[password]); else $fail = write_message(_PASSWORDTWICE); if(!isset($fail)) {