From 430a19f3f227eaa88d19ca6fa6499db417de9155 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 3 Mar 2008 14:03:22 +0000 Subject: [PATCH] get_magic_quotes_* functions deprecated in PHP 5.3.x. Check for existance and ignore deprecation warnings. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12987 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/init.php | 2 +- src/configtest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/init.php b/include/init.php index d12b71d8..05d9cbae 100644 --- a/include/init.php +++ b/include/init.php @@ -203,7 +203,7 @@ ini_set('magic_quotes_runtime','0'); /* if running with magic_quotes_gpc then strip the slashes from POST and GET global arrays */ -if (get_magic_quotes_gpc()) { +if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) { sqstripslashes($_GET); sqstripslashes($_POST); } diff --git a/src/configtest.php b/src/configtest.php index 967ac11a..a89020bf 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -303,7 +303,8 @@ if (function_exists('mb_internal_encoding') && /** * Do not use SquirrelMail with magic_quotes_* on. */ -if ( get_magic_quotes_runtime() || get_magic_quotes_gpc() || +if ( (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime()) || + (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) || ( (bool) ini_get('magic_quotes_sybase') && ini_get('magic_quotes_sybase') != 'off' ) ) { $magic_quotes_warning='You have enabled any one of magic_quotes_runtime, ' -- 2.25.1