From 44b838e3f40277a4e55a9c8804365ab973e11d4b Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <jkowalsk@student.agh.edu.pl>
Date: Sat, 05 Sep 2015 23:52:14 +0000
Subject: [PATCH] Fix incorrect serviceUrl passed to CAS when GET method was used

---
 uphpCAS.php |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/uphpCAS.php b/uphpCAS.php
index 955d204..d073771 100644
--- a/uphpCAS.php
+++ b/uphpCAS.php
@@ -56,8 +56,17 @@
 		if($port != 0) {
 			$url .= ':'.$port;
 		}
+		
 		$url .= $_SERVER['REQUEST_URI'];
 		
+		if(isset($_GET['ticket'])) {
+			$pos = max(
+				strrpos($url, '?ticket='),
+				strrpos($url, '&ticket=')
+			);
+			$url = substr($url, 0, $pos);
+		}
+		
 		return $url;
 	}
 	

--
Gitblit v1.9.1