From 7bc8676206022c7895d21e826961de0fe2e69d8e Mon Sep 17 00:00:00 2001 From: Nico Bouthoorn Date: Tue, 13 Aug 2024 11:50:32 +0200 Subject: [PATCH 1/2] Changed mysql function names in mysqli_* --- backend/php-mysql+file/mysql_import.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/backend/php-mysql+file/mysql_import.php b/backend/php-mysql+file/mysql_import.php index 8d399e0..fbc4314 100644 --- a/backend/php-mysql+file/mysql_import.php +++ b/backend/php-mysql+file/mysql_import.php @@ -1,7 +1,8 @@ '; $comment = (isset($row["TABLE_COMMENT"]) ? $row["TABLE_COMMENT"] : ""); if ($comment) { $xml .= ''.$comment.''; } $q = "SELECT * FROM COLUMNS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."'"; - $result2 = mysql_query($q); - while ($row = mysql_fetch_array($result2)) { + $result2 = mysqli_query($mysqli,$q); + while ($row = mysqli_fetch_array($result2)) { $name = $row["COLUMN_NAME"]; $type = $row["COLUMN_TYPE"]; $comment = (isset($row["COLUMN_COMMENT"]) ? $row["COLUMN_COMMENT"] : ""); @@ -43,9 +44,9 @@ WHERE CONSTRAINT_TYPE = 'FOREIGN KEY' AND c.TABLE_SCHEMA = '".$db."' AND c.TABLE_NAME = '".$table."' AND k.COLUMN_NAME = '".$name."'"; - $result3 = mysql_query($q); + $result3 = mysqli_query($mysqli,$q); - while ($row = mysql_fetch_array($result3)) { + while ($row = mysqli_fetch_array($result3)) { $xml .= ''; } @@ -54,10 +55,10 @@ /* keys */ $q = "SELECT * FROM STATISTICS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."' ORDER BY SEQ_IN_INDEX ASC"; - $result2 = mysql_query($q); + $result2 = mysqli_query($mysqli,$q); $idx = array(); - while ($row = mysql_fetch_array($result2)) { + while ($row = mysqli_fetch_array($result2)) { $name = $row["INDEX_NAME"]; if (array_key_exists($name, $idx)) { $obj = $idx[$name]; @@ -92,4 +93,4 @@ $arr[] = ''; return implode("\n",$arr); } -?> \ No newline at end of file +?> From 22e0c2da64e606f9dc81be2ea5cd1f12ce51700d Mon Sep 17 00:00:00 2001 From: Nico Bouthoorn Date: Tue, 13 Aug 2024 11:52:39 +0200 Subject: [PATCH 2/2] Comment out get_magic_quotes_gpc, for php 8* --- backend/php-file/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/php-file/index.php b/backend/php-file/index.php index 054ce47..fe0f474 100644 --- a/backend/php-file/index.php +++ b/backend/php-file/index.php @@ -13,9 +13,9 @@ $keyword = "data/".basename($keyword); $f = fopen($keyword, "w"); $data = file_get_contents("php://input"); - if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) { - $data = stripslashes($data); - } +// if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) { +// $data = stripslashes($data); +// } fwrite($f, $data); fclose($f); header("HTTP/1.0 201 Created");