diff options
author | Adam Harvey <aharvey@php.net> | 2013-09-10 11:42:42 -0700 |
---|---|---|
committer | Adam Harvey <aharvey@php.net> | 2013-09-10 11:42:42 -0700 |
commit | fba290c061027c24e4c8effdba37addd3430c3d4 (patch) | |
tree | 862dfc6e43bbd14fd7199cd4c5c63ad6a2cb92d5 /ext/curl/interface.c | |
parent | b8beb657ca725913ab8568eb218691bdd2f838c5 (diff) | |
download | php-git-fba290c061027c24e4c8effdba37addd3430c3d4.tar.gz |
Allow CURLOPT_FOLLOWLOCATION to be used with open_basedir.
Newer versions of libcurl prevent file:// location response headers by default,
which means that the open_basedir check is unnecessary — the fact
CURLOPT_REDIR_PROTOCOLS can't set CURLPROTO_FILE with open_basedir enabled
means that there's no possibility of breaching the open_basedir restriction,
and this allows HTTP redirects to be followed automatically.
Implements FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or
safe_mode).
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r-- | ext/curl/interface.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index ac872dfbc2..591315973c 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2504,6 +2504,7 @@ string_copy: case CURLOPT_FOLLOWLOCATION: convert_to_long_ex(zvalue); +#if LIBCURL_VERSION_NUM < 0x071304 if (PG(open_basedir) && *PG(open_basedir)) { if (Z_LVAL_PP(zvalue) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); @@ -2511,6 +2512,7 @@ string_copy: return 1; } } +#endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; |