Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
workaround for CURLOPT_FOLLOWLOCATION cannot be activated when safe_m…
…ode is enabled or an open_basedir is set
  • Loading branch information
jakoch committed Aug 16, 2012
1 parent 148da51 commit 0ecbb0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions framework/Koch/Tools/TracRPC.php
Expand Up @@ -1340,6 +1340,16 @@ private function _doCurlRequest()

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

// workaround for CURLOPT_FOLLOWLOCATION
// cannot be activated when safe_mode is enabled or an open_basedir is set
if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
} else {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
// alternative following handling via header 301?
}

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
Expand Down

0 comments on commit 0ecbb0b

Please sign in to comment.