From 2b428921ab341cab8f5a4af46f12e3034ac3a66a Mon Sep 17 00:00:00 2001 From: DotRoll Ltd Date: Fri, 13 May 2011 13:06:07 +0200 Subject: [PATCH 1/2] Fixes #1: CURLOPT_INTERFACE breaks on proxy setup --- EpiOAuth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EpiOAuth.php b/EpiOAuth.php index 6831b33..32d0ede 100644 --- a/EpiOAuth.php +++ b/EpiOAuth.php @@ -168,7 +168,8 @@ protected function curlInit($url) curl_setopt($ch, CURLOPT_ENCODING, ''); if($this->followLocation) curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1') + if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && + !preg_match('/^(|10\.127\.|192\.168\.|172\.(16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\.)/', $_SERVER['SERVER_ADDR'])) curl_setopt($ch, CURLOPT_INTERFACE, $_SERVER ['SERVER_ADDR']); // if the certificate exists then use it, else bypass ssl checks From 1e46a76870a2be193824b0c5e3334bed4b757fa9 Mon Sep 17 00:00:00 2001 From: DotRoll Ltd Date: Sat, 14 May 2011 19:27:00 +0200 Subject: [PATCH 2/2] Fixes #2: Regexp messed up --- EpiOAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EpiOAuth.php b/EpiOAuth.php index 32d0ede..67a72d8 100644 --- a/EpiOAuth.php +++ b/EpiOAuth.php @@ -169,7 +169,7 @@ protected function curlInit($url) if($this->followLocation) curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && - !preg_match('/^(|10\.127\.|192\.168\.|172\.(16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\.)/', $_SERVER['SERVER_ADDR'])) + !preg_match('/^(10\.|127\.|192\.168\.|172\.(16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\.)/', $_SERVER['SERVER_ADDR'])) curl_setopt($ch, CURLOPT_INTERFACE, $_SERVER ['SERVER_ADDR']); // if the certificate exists then use it, else bypass ssl checks