Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Only set the FOLLOWLOCATION curl opt if we are not in safe mode #26

Open
wants to merge 1 commit into from

3 participants

@leto

This small patch allows the S3 library to be used in safe mode. Without this patch, it cannot be used in safe mode because the FOLLOWLOCATION curl opt is only allowed when not in safe mode.

@noahm

Safe mode isn't the only situation where setting FOLLOWLOCATION will produce a warning. A better solution is provided here: #21

@deviarte

Hope this pull request gets merged soon, just hit the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 S3.php
View
5 S3.php
@@ -1817,7 +1817,10 @@ public function getResponse()
curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
curl_setopt($curl, CURLOPT_WRITEFUNCTION, array(&$this, '__responseWriteCallback'));
curl_setopt($curl, CURLOPT_HEADERFUNCTION, array(&$this, '__responseHeaderCallback'));
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
+ if (!ini_get('safe_mode'))
+ {
+ curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
+ }
// Request types
switch ($this->verb)
Something went wrong with that request. Please try again.