From a660177f51333207165dbdd0795889827adea10b Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <jkowalsk@student.agh.edu.pl>
Date: Sun, 06 Sep 2015 14:39:07 +0000
Subject: [PATCH] Remove finally block to support PHP 5.4 and older
---
uphpCAS.php | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/uphpCAS.php b/uphpCAS.php
index d073771..77ba8d3 100644
--- a/uphpCAS.php
+++ b/uphpCAS.php
@@ -123,7 +123,7 @@
}
public function logout($returnUrl = NULL) {
- session_start();
+ @session_start();
if($this->isAuthenticated()) {
unset($_SESSION[$this->sessionName]);
header('Location: '.$this->logoutUrl($returnUrl));
@@ -139,7 +139,7 @@
}
public function authenticate() {
- session_start();
+ @session_start();
if($this->isAuthenticated()) {
return $_SESSION[$this->sessionName];
} elseif(isset($_REQUEST['ticket'])) {
@@ -228,13 +228,15 @@
}
}
} catch(Exception $e) {
- throw new JasigException('Authentication error: CAS server'
- .' response invalid - parse error', 0, $e);
- } finally {
libxml_clear_errors();
libxml_disable_entity_loader($xmlEntityLoader);
libxml_use_internal_errors($xmlInternalErrors);
+ throw new JasigException('Authentication error: CAS server'
+ .' response invalid - parse error', 0, $e);
}
+ libxml_clear_errors();
+ libxml_disable_entity_loader($xmlEntityLoader);
+ libxml_use_internal_errors($xmlInternalErrors);
$failure = $xml->getElementsByTagName('authenticationFailure');
$success = $xml->getElementsByTagName('authenticationSuccess');
--
Gitblit v1.9.1