From 180239ca5124f88ebdb958048d9dcbac2186df71 Mon Sep 17 00:00:00 2001 From: jmunro Date: Mon, 7 Oct 2002 14:08:50 +0000 Subject: [PATCH] This should fix the extra quoting when using magic_quotes_gpc. No need to do this in validate, lets do it in global. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3789 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/global.php | 9 +++------ include/validate.php | 13 ------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/functions/global.php b/functions/global.php index b9d63097..1bac6286 100644 --- a/functions/global.php +++ b/functions/global.php @@ -33,15 +33,12 @@ if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { $_SESSION =& $HTTP_SESSION_VARS; } -/* if running with register_globals = 0 and - magic_quotes_gpc then strip the slashes +/* if running with magic_quotes_gpc then strip the slashes from POST and GET global arrays */ if (get_magic_quotes_gpc()) { - if (ini_get('register_globals') == 0) { - sqstripslashes($_GET); - sqstripslashes($_POST); - } + sqstripslashes($_GET); + sqstripslashes($_POST); } /* strip any tags added to the url from PHP_SELF. diff --git a/include/validate.php b/include/validate.php index 79b1bd15..22d4b9a0 100644 --- a/include/validate.php +++ b/include/validate.php @@ -40,19 +40,6 @@ require_once(SM_PATH . 'functions/global.php'); is_logged_in(); -/* Remove all slashes for form values. */ -if (get_magic_quotes_gpc()) { - global $REQUEST_METHOD; - - if ($REQUEST_METHOD == 'POST') { - global $HTTP_POST_VARS; - RemoveSlashes($HTTP_POST_VARS); - } else if ($REQUEST_METHOD == 'GET') { - global $HTTP_GET_VARS; - RemoveSlashes($HTTP_GET_VARS); - } -} - /** * Auto-detection * -- 2.25.1