From a18b3b080890b34060ec8e3cdff3232ef46fb989 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 24 Jan 2008 15:27:49 +0000
Subject: [PATCH] Remove magic quotes as a part of the initialization of
 simpleSAMLphp.

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

diff --git a/www/_include.php b/www/_include.php
index ab5e7dcab..26ce8ee85 100644
--- a/www/_include.php
+++ b/www/_include.php
@@ -1,5 +1,22 @@
 <?php
 
+/* 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;
+			}
+
+			/* Unescape the string. */
+			$v = stripslashes($v);
+		}
+	}
+}
 
 
 $path_extra = dirname(dirname(__FILE__)) . '/lib';
-- 
GitLab