summaryrefslogtreecommitdiff
path: root/ext/curl/tests/bug65646_open_basedir_new.phpt
blob: 991c4a2b8a5626650c3409c9838646721c5e54e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--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)