of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx).
(Gustavo)
+- cURL:
+ . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
+ or safe_mode). (Adam)
+
- Session:
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
(Yasuo)
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");
return 1;
}
}
+#endif
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
break;
--- /dev/null
+--TEST--
+Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir disabled
+--SKIPIF--
+<?php
+if (!extension_loaded('curl')) exit("skip curl extension not loaded");
+if (ini_get('open_basedir')) exit("skip open_basedir is set");
+?>
+--FILE--
+<?php
+$ch = curl_init();
+var_dump(curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true));
+curl_close($ch);
+?>
+--EXPECT--
+bool(true)
--- /dev/null
+--TEST--
+Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl >= 7.19.4
+--INI--
+open_basedir=.
+--SKIPIF--
+<?php
+if (!extension_loaded('curl')) exit("skip curl extension not loaded");
+if (version_compare(curl_version()['version'], '7.19.4', '<')) exit("skip curl version is too old");
+?>
+--FILE--
+<?php
+$ch = curl_init();
+var_dump(curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true));
+var_dump(curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_FILE));
+var_dump(curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_FILE));
+curl_close($ch);
+?>
+--EXPECTF--
+bool(true)
+
+Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d
+bool(false)
+
+Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d
+bool(false)
--- /dev/null
+--TEST--
+Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl < 7.19.4
+--INI--
+open_basedir=.
+--SKIPIF--
+<?php
+if (!extension_loaded('curl')) exit("skip curl extension not loaded");
+if (version_compare(curl_version()['version'], '7.19.4', '>=')) exit("skip curl version is too new");
+?>
+--FILE--
+<?php
+$ch = curl_init();
+var_dump(curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true));
+curl_close($ch);
+?>
+--EXPECTF--
+Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s on line %d
+bool(false)
+++ /dev/null
---TEST--
-CURLOPT_FOLLOWLOCATION case check open_basedir
---CREDITS--
-WHITE new media architects - Dennis
---INI--
-open_basedir = DIRECTORY_SEPARATOR."tmp";
---SKIPIF--
-<?php
-if (!extension_loaded("curl")) print "skip cURL not loaded";
-?>
---FILE--
-<?php
-print (ini_get("OPEN_BASEDIR"));
-$ch = curl_init();
-$succes = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
-curl_close($ch);
-var_dump($succes);
-?>
---EXPECTF--
-Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s.php on line %d
-bool(false)
-