From: Michael J. Rubinsky Date: Mon, 20 Jul 2009 22:32:36 +0000 (-0400) Subject: Don't leak Horde_Http_Client exceptions X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6cc29ce18f7704ad1002579f1e1b7be8c2f8c7b8;p=horde.git Don't leak Horde_Http_Client exceptions --- diff --git a/framework/Oauth/lib/Horde/Oauth/Consumer.php b/framework/Oauth/lib/Horde/Oauth/Consumer.php index f4d87204a..baf4ebd27 100644 --- a/framework/Oauth/lib/Horde/Oauth/Consumer.php +++ b/framework/Oauth/lib/Horde/Oauth/Consumer.php @@ -68,10 +68,14 @@ class Horde_Oauth_Consumer $client = new Horde_Http_Client; - $response = $client->post( - $this->requestTokenUrl, - $request->buildHttpQuery() - ); + try { + $response = $client->post( + $this->requestTokenUrl, + $request->buildHttpQuery() + ); + } catch (Horde_Http_Client_Exception $e) { + throw new Horde_Oauth_Exception($e->getMessage()); + } return Horde_Oauth_Token::fromString($response->getBody()); } @@ -108,10 +112,14 @@ class Horde_Oauth_Consumer $request->sign($this->signatureMethod, $this, $token); $client = new Horde_Http_Client; - $response = $client->post( - $this->accessTokenUrl, - $request->buildHttpQuery() - ); + try { + $response = $client->post( + $this->accessTokenUrl, + $request->buildHttpQuery() + ); + } catch (Horde_Http_Client_Exception $e) { + throw new Horde_Oauth_Exception($e->getMessage()); + } return Horde_Oauth_Token::fromString($response->getBody()); }