summaryrefslogtreecommitdiff
path: root/ext/curl/streams.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/curl/streams.c')
-rw-r--r--ext/curl/streams.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 829fe3eb71..ab5c4c99fd 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -289,7 +289,11 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
curl_easy_setopt(curlstream->curl, CURLOPT_WRITEHEADER, stream);
/* currently buggy (bug is in curl) */
- curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
+ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
+ }
curl_easy_setopt(curlstream->curl, CURLOPT_ERRORBUFFER, curlstream->errstr);
curl_easy_setopt(curlstream->curl, CURLOPT_VERBOSE, 0);