summaryrefslogtreecommitdiff
path: root/ext/curl/interface.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-08-10 14:40:13 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-08-10 14:40:13 +0000
commita4d2f0430723b4f0cf8a68e8b8a7e549658187ab (patch)
tree7886de0385411daf35fc13a65a3281d8aa247413 /ext/curl/interface.c
parente5fe441cbd20df608a1a71e18644caf74c82f691 (diff)
downloadphp-git-a4d2f0430723b4f0cf8a68e8b8a7e549658187ab.tar.gz
Fixed overflow on 64bit systems in str_repeat() and wordwrap().
Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode are enabled. # Patches by Stefan E.
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r--ext/curl/interface.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index dc1efe8021..888a822e66 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1168,7 +1168,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_FTPLISTONLY:
case CURLOPT_FTPAPPEND:
case CURLOPT_NETRC:
- case CURLOPT_FOLLOWLOCATION:
case CURLOPT_PUT:
#if CURLOPT_MUTE != 0
case CURLOPT_MUTE:
@@ -1219,6 +1218,16 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
break;
+ case CURLOPT_FOLLOWLOCATION:
+ convert_to_long_ex(zvalue);
+ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
+ if (Z_LVAL_PP(zvalue) != 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set");
+ RETURN_FALSE;
+ }
+ }
+ error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
+ break;
case CURLOPT_URL:
case CURLOPT_PROXY:
case CURLOPT_USERPWD: