From 2489c2933217b0039d4eb4d26d32ee902dc3e11d Mon Sep 17 00:00:00 2001
From: Dan Tsosie <dtsosie@godaddy.com>
Date: Mon, 5 May 2014 17:53:53 -0700
Subject: [PATCH] Fix handleLogout ignoring wreply override

---
 modules/adfs/lib/IdP/ADFS.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/adfs/lib/IdP/ADFS.php b/modules/adfs/lib/IdP/ADFS.php
index 5fc95f505..d7fc51f11 100644
--- a/modules/adfs/lib/IdP/ADFS.php
+++ b/modules/adfs/lib/IdP/ADFS.php
@@ -175,6 +175,13 @@ class sspmod_adfs_IdP_ADFS {
 	}
 	
 	public static function receiveLogoutMessage(SimpleSAML_IdP $idp) {
+		// if a redirect is to occur based on wreply, we will redirect to url as
+		// this implies an override to normal sp notification.
+		if(isset($_GET['wreply']) && !empty($_GET['wreply'])) {
+			$idp->doLogoutRedirect(SimpleSAML_Utilities::checkURLAllowed($_GET['wreply']));
+			assert(FALSE);
+		}
+
 		$state = array(
 			'Responder' => array('sspmod_adfs_IdP_ADFS', 'sendLogoutResponse'),
 		);
-- 
GitLab