From 2c3acc7929ce973c351197b025d8dedb37c2a1a4 Mon Sep 17 00:00:00 2001 From: Sergi Ullastre Date: Mon, 29 Nov 2021 11:32:14 +0100 Subject: [PATCH] MDI-1440 Removed deprecated get/set magic_quotes methods --- src/adodb5/adodb-csvlib.inc.php | 1 - src/adodb5/adodb-perf.inc.php | 2 +- src/adodb5/adodb-xmlschema.inc.php | 10 ---------- src/adodb5/adodb-xmlschema03.inc.php | 10 ---------- src/adodb5/adodb.inc.php | 4 ++-- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/adodb5/adodb-csvlib.inc.php b/src/adodb5/adodb-csvlib.inc.php index 1f7543f9..7ad251a8 100644 --- a/src/adodb5/adodb-csvlib.inc.php +++ b/src/adodb5/adodb-csvlib.inc.php @@ -249,7 +249,6 @@ function csv2rs($url,&$err,$timeout=0, $rsclass='ADORecordSet_array') //var_dump($arr); if (!is_array($arr)) { $err = "Recordset had unexpected EOF (in serialized recordset)"; - if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!"; return $false; } $rs = new $rsclass(); diff --git a/src/adodb5/adodb-perf.inc.php b/src/adodb5/adodb-perf.inc.php index f9db96ea..17fc36bb 100644 --- a/src/adodb5/adodb-perf.inc.php +++ b/src/adodb5/adodb-perf.inc.php @@ -691,7 +691,7 @@ function UI($pollsecs=5) // magic quotes - if (isset($_GET['sql']) && get_magic_quotes_gpc()) { + if (isset($_GET['sql'])) { $_GET['sql'] = $_GET['sql'] = str_replace(array("\\'",'\"'),array("'",'"'),$_GET['sql']); } diff --git a/src/adodb5/adodb-xmlschema.inc.php b/src/adodb5/adodb-xmlschema.inc.php index 777dd497..14ee65d0 100644 --- a/src/adodb5/adodb-xmlschema.inc.php +++ b/src/adodb5/adodb-xmlschema.inc.php @@ -1253,12 +1253,6 @@ class adoSchema { */ var $objectPrefix = ''; - /** - * @var long Original Magic Quotes Runtime value - * @access private - */ - var $mgq; - /** * @var long System debug * @access private @@ -1303,9 +1297,6 @@ class adoSchema { */ function __construct( &$db ) { // Initialize the environment - $this->mgq = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - $this->db = $db; $this->debug = $this->db->debug; $this->dict = NewDataDictionary( $this->db ); @@ -2193,7 +2184,6 @@ function getSQL( $format = NULL, $sqlArray = NULL ) { * @deprecated adoSchema now cleans up automatically. */ function Destroy() { - set_magic_quotes_runtime( $this->mgq ); unset( $this ); } } diff --git a/src/adodb5/adodb-xmlschema03.inc.php b/src/adodb5/adodb-xmlschema03.inc.php index 2d484f76..50f56690 100644 --- a/src/adodb5/adodb-xmlschema03.inc.php +++ b/src/adodb5/adodb-xmlschema03.inc.php @@ -1352,12 +1352,6 @@ class adoSchema { */ var $objectPrefix = ''; - /** - * @var long Original Magic Quotes Runtime value - * @access private - */ - var $mgq; - /** * @var long System debug * @access private @@ -1407,9 +1401,6 @@ class adoSchema { */ function __construct( &$db ) { // Initialize the environment - $this->mgq = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - $this->db = $db; $this->debug = $this->db->debug; $this->dict = NewDataDictionary( $this->db ); @@ -2374,7 +2365,6 @@ function getSQL( $format = NULL, $sqlArray = NULL ) { * @deprecated adoSchema now cleans up automatically. */ function Destroy() { - set_magic_quotes_runtime( $this->mgq ); unset( $this ); } } diff --git a/src/adodb5/adodb.inc.php b/src/adodb5/adodb.inc.php index 03725588..d8f3e940 100644 --- a/src/adodb5/adodb.inc.php +++ b/src/adodb5/adodb.inc.php @@ -691,7 +691,7 @@ function Quote($s) */ function QMagic($s) { - return $this->qstr($s,get_magic_quotes_gpc()); + return $this->qstr($s); } function q(&$s) @@ -1798,7 +1798,7 @@ function CacheExecute($secs2cache,$sql=false,$inputarr=false) if (!$rs) { // no cached rs found if ($this->debug) { - if (get_magic_quotes_runtime() && !$this->memCache) { + if (!$this->memCache) { ADOConnection::outp("Please disable magic_quotes_runtime - it corrupts cache files :("); } if ($this->debug !== -1) ADOConnection::outp( " $md5file cache failure: $err (see sql below)");