From 0d5b3dfd47efc76378f4681b319e6276e5399c1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Mon, 25 Feb 2008 08:08:50 +0000
Subject: [PATCH] this generated a notice error in some versions of php

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@321 44740490-163a-0410-bde0-09ae8108e29a
---
 www/_include.php | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/www/_include.php b/www/_include.php
index 26ce8ee85..e1322e90e 100644
--- a/www/_include.php
+++ b/www/_include.php
@@ -3,22 +3,21 @@
 /* Remove magic quotes. */
 if(get_magic_quotes_gpc()) {
 	foreach(array('_GET', '_POST', '_COOKIE', '_REQUEST') as $a) {
-		foreach($$a as &$v) {
-
-			/* We don't use array-parameters anywhere.
-			 * Ignore any that may appear.
-			 */
-			if(is_array($v)) {
-				continue;
+		if (is_array($$a)) {
+			foreach($$a as &$v) {
+				/* We don't use array-parameters anywhere.
+				 * Ignore any that may appear.
+				 */
+				if(is_array($v)) {
+					continue;
+				}
+				/* Unescape the string. */
+				$v = stripslashes($v);
 			}
-
-			/* Unescape the string. */
-			$v = stripslashes($v);
 		}
 	}
 }
 
-
 $path_extra = dirname(dirname(__FILE__)) . '/lib';
 
 $path = ini_get('include_path');
-- 
GitLab