summaryrefslogtreecommitdiff
path: root/adodb-xmlschema03.inc.php
diff options
context:
space:
mode:
authorjrfnl <jrfnl@users.noreply.github.com>2018-03-29 22:41:18 +0200
committerDamien Regad <dregad@mantisbt.org>2018-03-30 03:05:47 +0200
commit61e01e402903a6d59d4698be4aac3fd29556a49f (patch)
tree34f66fe90d4ddc7a06498536fe9257ed3ba6537b /adodb-xmlschema03.inc.php
parent37b20820ba512ae684c06b93171921037bc6704b (diff)
downloadadodb-61e01e402903a6d59d4698be4aac3fd29556a49f.tar.gz
adodb-61e01e402903a6d59d4698be4aac3fd29556a49f.tar.bz2
adodb-61e01e402903a6d59d4698be4aac3fd29556a49f.zip
Don't bother with magic quotes when not available
Magic quotes were removed from PHP in v5.4.0. The return value of `get_magic_quotes_runtime()` will be 0 if `magic_quotes_runtime` is off, 1 otherwise. And as of PHP 5.4.0, it will always returns `false`. This minor change prevents trying to set the ini value when the ini rective is not available and cleans up some old/unused/commented out code. Refs: * http://php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime * http://php.net/manual/en/function.get-magic-quotes-runtime.php Fixes #407 Signed-off-by: Damien Regad <dregad@mantisbt.org> Minor changes to original commit message
Diffstat (limited to 'adodb-xmlschema03.inc.php')
-rw-r--r--adodb-xmlschema03.inc.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/adodb-xmlschema03.inc.php b/adodb-xmlschema03.inc.php
index c1ecb885..4d1faad3 100644
--- a/adodb-xmlschema03.inc.php
+++ b/adodb-xmlschema03.inc.php
@@ -1409,8 +1409,9 @@ class adoSchema {
function __construct( $db ) {
// Initialize the environment
$this->mgq = get_magic_quotes_runtime();
- #set_magic_quotes_runtime(0);
- ini_set("magic_quotes_runtime", 0);
+ if ($this->mgq !== false) {
+ ini_set('magic_quotes_runtime', 0 );
+ }
$this->db = $db;
$this->debug = $this->db->debug;
@@ -2377,8 +2378,9 @@ class adoSchema {
* @deprecated adoSchema now cleans up automatically.
*/
function Destroy() {
- ini_set("magic_quotes_runtime", $this->mgq );
- #set_magic_quotes_runtime( $this->mgq );
+ if ($this->mgq !== false) {
+ ini_set('magic_quotes_runtime', $this->mgq );
+ }
}
}