From ad352ae354176d8aee3e8a83a496b46020ae5015 Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Sat, 1 May 2021 22:23:50 +0530 Subject: [PATCH] update getm_magic_quotes function checks --- install/upgrade/classes/AddConfToFile.php | 2 +- install/upgrade/php/latin1_database_to_utf8.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/upgrade/classes/AddConfToFile.php b/install/upgrade/classes/AddConfToFile.php index f2525b4d0..d88678740 100644 --- a/install/upgrade/classes/AddConfToFile.php +++ b/install/upgrade/classes/AddConfToFile.php @@ -86,7 +86,7 @@ class AddConfToFile public function checkString($string) { - if (get_magic_quotes_gpc()) { + if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { $string = stripslashes($string); } if (!is_numeric($string)) { diff --git a/install/upgrade/php/latin1_database_to_utf8.php b/install/upgrade/php/latin1_database_to_utf8.php index a0fbcc7e5..4b7e6a8bc 100644 --- a/install/upgrade/php/latin1_database_to_utf8.php +++ b/install/upgrade/php/latin1_database_to_utf8.php @@ -25,7 +25,7 @@ */ if (!defined('_PS_MAGIC_QUOTES_GPC_')) { - define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); + define('_PS_MAGIC_QUOTES_GPC_', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()); } if (!defined('_PS_MYSQL_REAL_ESCAPE_STRING_')) { define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string'));