From cbc6d98afcc6d28887cbd839fca9d1c6cb63a800 Mon Sep 17 00:00:00 2001
From: Roland Haeder <roland@mxchange.org>
Date: Sat, 4 Jul 2015 16:29:29 +0200
Subject: [PATCH] Backward-compatiblity hack for PHP 5.4 installations.

Signed-off-by: Roland Haeder <roland@mxchange.org>
---
 lib/httpclient.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/httpclient.php b/lib/httpclient.php
index 865fc9029e..fc3f0ec087 100644
--- a/lib/httpclient.php
+++ b/lib/httpclient.php
@@ -220,13 +220,16 @@ class HTTPClient extends HTTP_Request2
             $this->config['follow_redirects'] = $follow_redirects;
             return $this->doRequest($url, self::METHOD_HEAD, $headers);
         } catch (Exception $e) {
-            // Let the exception go on its merry way.
-            throw $e;
-        } finally {
             // reset to the old value
             $this->config['follow_redirects'] = $old_follow;
+
+            // Let the exception go on its merry way.
+            throw $e;
         }
         //we've either returned or thrown exception here
+
+        // reset to the old value
+        $this->config['follow_redirects'] = $old_follow;
     }
 
     /**
-- 
2.39.5