xref: /PHP-7.1/ext/curl/tests/bug61948-win32.phpt (revision 7af945e2)
1--TEST--
2Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
3--SKIPIF--
4<?php if (!extension_loaded("curl")) print "skip";
5if(substr(PHP_OS, 0, 3) != 'WIN' )
6  die("skip Not Valid for Linux");
7?>
8--FILE--
9<?php
10  $base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948";
11  mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true);
12
13  ini_set("open_basedir", $base_dir);
14
15  $ch = curl_init();
16  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
17  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "$base_dir/foo"));
18  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
19  curl_close($ch);
20?>
21--CLEAN--
22<?php
23	$base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948";
24	rmdir("$base_dir/foo");
25	rmdir($base_dir);
26?>
27--EXPECTF--
28%a
29bool(true)
30
31Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (%sbug61948) in %sbug61948-win32.php on line %d
32bool(false)
33