From: pdontthink Date: Wed, 27 Jan 2010 23:36:52 +0000 (+0000) Subject: Avoid notices in some environments X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;ds=sidebyside;h=49ec41bc19432f2e2a22abff92494209809aa18e;p=squirrelmail.git Avoid notices in some environments git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13897 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/include/init.php b/include/init.php index 28f7b451..79c39c03 100644 --- a/include/init.php +++ b/include/init.php @@ -276,9 +276,12 @@ if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) { * QUERY_STRING also needs the same treatment since it is * used in php_self(). */ -$_SERVER['REQUEST_URI'] = htmlspecialchars($_SERVER['REQUEST_URI']); -$_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']); -$_SERVER['QUERY_STRING'] = htmlspecialchars($_SERVER['QUERY_STRING']); +if (isset($_SERVER['REQUEST_URI'])) + $_SERVER['REQUEST_URI'] = htmlspecialchars($_SERVER['REQUEST_URI']); +if (isset($_SERVER['PHP_SELF'])) + $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']); +if (isset($_SERVER['QUERY_STRING'])) + $_SERVER['QUERY_STRING'] = htmlspecialchars($_SERVER['QUERY_STRING']); $PHP_SELF = php_self();