From 1d5c8cb96ad9a1a9f61991a19b1362142b074430 Mon Sep 17 00:00:00 2001 From: Andreas Jakum Date: Tue, 20 Oct 2020 21:23:26 +0200 Subject: Migrate to mysqli to support PHP7.4 instead of stone-age PHP5.6 .. --- db.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db.class.php b/db.class.php index 1a3647f..afe463d 100644 --- a/db.class.php +++ b/db.class.php @@ -13,33 +13,33 @@ function DB($user, $pass, $host, $dbname) { } function connect() { - $this->db = mysql_connect($this->host, $this->user, $this->pass) + $this->db = mysqli_connect($this->host, $this->user, $this->pass) or $this->error("Verbindungsaufbau fehlgeschlagen"); - mysql_select_db($this->dbname); + mysqli_select_db($this->db, $this->dbname); } function error($msg) { - die($msg . ": " . @mysql_error()); + die($msg . ": " . @mysqli_error($this->db)); } function query($query) { - $this->res = mysql_query($query, $this->db) + $this->res = mysqli_query($this->db, $query) or $this->error("Fehler bei Datenbankanfrage"); } function escape_string($string) { - return mysql_real_escape_string($string, $this->db); + return mysqli_real_escape_string($this->db, $string); } function numObjects() { - return mysql_num_rows($this->res); + return mysqli_num_rows($this->res); } function getNextObject() { if (!$this->res) { return; } - return mysql_fetch_object($this->res); + return mysqli_fetch_object($this->res); } } -- cgit v1.2.1 From 75242961eedea7bf397c3736305ff1b4a01efd02 Mon Sep 17 00:00:00 2001 From: Andreas Jakum Date: Sat, 26 Dec 2020 23:06:50 +0100 Subject: Replace abused mysql_escape_string with a regex check. --- index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index a95fd6f..72213b0 100644 --- a/index.php +++ b/index.php @@ -1,9 +1,9 @@ Date: Sat, 26 Dec 2020 23:08:38 +0100 Subject: Add missing parenthesis. --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 72213b0..ecfdd0d 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,8 @@