Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

CURLOPT_INTERFACE setup breaks on proxy setup #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion EpiOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line has the regexp messed up, needs a fix.

curl_setopt($ch, CURLOPT_INTERFACE, $_SERVER ['SERVER_ADDR']);

// if the certificate exists then use it, else bypass ssl checks
Expand Down