diff --git a/lib/SimpleSAML/Bindings/SAML20/HTTPRedirect.php b/lib/SimpleSAML/Bindings/SAML20/HTTPRedirect.php
index 48d6c9b2243e311e30764ea48453cd8dbb5cb149..a372e6d3edd125d44eaab3f23340552e5aae8472 100644
--- a/lib/SimpleSAML/Bindings/SAML20/HTTPRedirect.php
+++ b/lib/SimpleSAML/Bindings/SAML20/HTTPRedirect.php
@@ -91,10 +91,6 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect {
 
 		if($_GET['RelayState']) {
 			$relaystate = $_GET['RelayState'];
-			/* Remove any magic quotes that php may have added. */
-			if(get_magic_quotes_gpc()) {
-				$relaystate = stripslashes($relaystate);
-			}
 			$query .= "&RelayState=" . urlencode($relaystate);
 		} 
 		
@@ -200,10 +196,6 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect {
 			throw new Exception('SAMLRequest parameter not set in paramter (on SAML 2.0 HTTP Redirect binding endpoint)');
 		}
 		$rawRequest = 	$get["SAMLRequest"];
-		/* We don't need to remove any magic quotes from the
-		 * SAMLRequest parameter since this parameter is guaranteed
-		 * to be base64-encoded.
-		 */
 
 		/* Check if the service provider has included a RelayState
 		 * parameter with the request. This parameter should be
@@ -211,10 +203,6 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect {
 		 */
 		if(array_key_exists('RelayState', $get)) {
 			$relaystate = $get['RelayState'];
-			/* Remove any magic quotes that php may have added. */
-			if(get_magic_quotes_gpc()) {
-				$relaystate = stripslashes($relaystate);
-			}
 		} else {
 			$relaystate = NULL;
 		}		
@@ -240,18 +228,10 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect {
 			throw new Exception('SAMLRequest parameter not set in paramter (on SAML 2.0 HTTP Redirect binding endpoint)');
 		}
 		$rawRequest = 	$get["SAMLRequest"];
-		/* We don't need to remove any magic quotes from the
-		 * SAMLRequest parameter since this parameter is guaranteed
-		 * to be base64-encoded.
-		 */
 
 		/* Check if a RelayState was provided with the request. */
 		if(array_key_exists('RelayState', $get)) {
 			$relaystate = $get['RelayState'];
-			/* Remove any magic quotes that php may have added. */
-			if(get_magic_quotes_gpc()) {
-				$relaystate = stripslashes($relaystate);
-			}
 		} else {
 			$relaystate = NULL;
 		}
@@ -276,18 +256,10 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect {
 			throw new Exception('SAMLResponse parameter not set in paramter (on SAML 2.0 HTTP Redirect binding endpoint)');
 		}
 		$rawRequest = 	$get["SAMLResponse"];
-		/* We don't need to remove any magic quotes from the
-		 * SAMLResponse parameter since this parameter is guaranteed
-		 * to be base64-encoded.
-		 */
 
 		/* Check if a RelayState was provided with the request. */
 		if(array_key_exists('RelayState', $get)) {
 			$relaystate = $get['RelayState'];
-			/* Remove any magic quotes that php may have added. */
-			if(get_magic_quotes_gpc()) {
-				$relaystate = stripslashes($relaystate);
-			}
 		} else {
 			$relaystate = NULL;
 		}
diff --git a/www/auth/login.php b/www/auth/login.php
index c4e96dd680467f67d9e75ec4a2e9077f35687e57..0839269495f3198aab49e9b6cf2d097adf38caa3 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -35,10 +35,6 @@ if (!array_key_exists('RelayState', $_REQUEST)) {
 }
 
 $relaystate = $_REQUEST['RelayState'];
-/* Remove backslashes if magic quotes are enabled. */
-if(get_magic_quotes_gpc()) {
-	$relaystate = stripslashes($relaystate);
-}
 
 
 if (isset($_POST['username'])) {
@@ -57,12 +53,6 @@ if (isset($_POST['username'])) {
 	$username = $_POST['username'];
 	$password = $_POST['password'];
 
-	/* Remove backslashes if magic quotes are enabled. */
-	if(get_magic_quotes_gpc()) {
-		$username = stripslashes($username);
-		$password = stripslashes($password);
-	}
-
 	/* Escape any characters with a special meaning in LDAP. The following
 	 * characters have a special meaning (according to RFC 2253):
 	 * ',', '+', '"', '\', '<', '>', ';', '*'
diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index 027f047501f98a2025cfe74050baf3eb0d10a7c5..7c2b82aa5480675cb38a2173f45db1142676550a 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -68,10 +68,6 @@ if (isset($_GET['SAMLRequest'])) {
 	try {
 
 		$requestid = $_GET['RequestID'];
-		/* Remove any "magic" quotes that php may have added. */
-		if(get_magic_quotes_gpc()) {
-			$requestid = stripslashes($requestid);
-		}
 
 		$session = SimpleSAML_Session::getInstance();
 		$authnrequest = $session->getAuthnRequest($requestid);
diff --git a/www/saml2/idp/SingleLogoutService.php b/www/saml2/idp/SingleLogoutService.php
index 3956c9c669abfcd2d3a1b039b97ff05ab4296c75..ee66ec26c8bed991833da61d36d99101ebbf2bc6 100644
--- a/www/saml2/idp/SingleLogoutService.php
+++ b/www/saml2/idp/SingleLogoutService.php
@@ -151,10 +151,6 @@ if ($spentityid) {
 		$relayState = SimpleSAML_Utilities::selfURL();
 		if (isset($_GET['RelayState'])) {
 			$relayState = $_GET['RelayState'];
-			/* Remove any magic quotes that php may have added. */
-			if(get_magic_quotes_gpc()) {
-				$relayState = stripslashes($relayState);
-			}
 		}
 
 		//$request, $remoteentityid, $relayState = null, $endpoint = 'SingleLogoutService', $direction = 'SAMLRequest', $mode = 'SP'
@@ -202,10 +198,6 @@ try {
 	$relayState = SimpleSAML_Utilities::selfURL();
 	if (isset($_GET['RelayState'])) {
 		$relayState = $_GET['RelayState'];
-		/* Remove any magic quotes that php may have added. */
-		if(get_magic_quotes_gpc()) {
-			$relayState = stripslashes($relayState);
-		}
 	}
 
 	//$request, $remoteentityid, $relayState = null, $endpoint = 'SingleLogoutService', $direction = 'SAMLRequest', $mode = 'SP'