bug61948.phpt 821 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
  3. --EXTENSIONS--
  4. curl
  5. --FILE--
  6. <?php
  7. $base_dir = __DIR__ . DIRECTORY_SEPARATOR . "bug61948";
  8. mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true);
  9. ini_set("open_basedir", $base_dir);
  10. $ch = curl_init();
  11. var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
  12. var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "$base_dir/foo"));
  13. var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
  14. curl_close($ch);
  15. ?>
  16. --CLEAN--
  17. <?php
  18. $base_dir = __DIR__ . DIRECTORY_SEPARATOR . "bug61948";
  19. rmdir("$base_dir/foo");
  20. rmdir($base_dir);
  21. ?>
  22. --EXPECTF--
  23. %a
  24. bool(true)
  25. Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (%sbug61948) in %sbug61948.php on line %d
  26. bool(false)