From 23c761cbf7193337f287e4012822fb2a01b15b48 Mon Sep 17 00:00:00 2001 From: Jeff Snider Date: Sun, 28 Aug 2016 12:15:24 -0500 Subject: [PATCH 1/3] preg_match requires // delimiters around the regular expression --- install/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install.php b/install/install.php index 95e2e40..2f93c04 100644 --- a/install/install.php +++ b/install/install.php @@ -153,7 +153,7 @@ function random_string ($charset_string, $length) if((!$_POST['email']) && !isADMIN) $fail .= "
"._EMAILREQUIRED." "._TRYAGAIN."
"; if($penname && !preg_match("!^[a-z0-9_ ]{3,30}$!i", $penname)) $fail = "
"._BADUSERNAME." "._TRYAGAIN."
"; // if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_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(!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)) { From 51d99fe63534f8c44fd4d6a3e09ac3e9bf279fee Mon Sep 17 00:00:00 2001 From: Jeff Snider Date: Sun, 28 Aug 2016 12:47:37 -0500 Subject: [PATCH 2/3] Explicitly set MySQL into a more permissive mode like it used to be. Installation failed with the more modern strict mode. --- includes/mysql_functions.php | 1 + includes/mysqli_functions.php | 1 + 2 files changed, 2 insertions(+) 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; } From 6c282797ed387002bdb75132f5cba2a98d436829 Mon Sep 17 00:00:00 2001 From: Rainer Volkrodt Date: Sat, 28 Jan 2017 15:22:40 +0100 Subject: [PATCH 3/3] Merge --- install/install.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/install/install.php b/install/install.php index 7b373a1..a647d8a 100644 --- a/install/install.php +++ b/install/install.php @@ -152,9 +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."
"; -<<<<<<< HEAD if(!preg_match("/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/", $_POST[email])) $fail = "
"._INVALIDEMAIL." "._TRYAGAIN."
"; ->>>>>>> 94417774241deeaf340c9434135fed42b738a15d if($_POST['password'] == $_POST['password2']) $encryptpassword = md5($_POST[password]); else $fail = write_message(_PASSWORDTWICE); if(!isset($fail)) {