bug61948-unix.phpt 650 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
  3. --EXTENSIONS--
  4. curl
  5. --SKIPIF--
  6. <?php if(substr(PHP_OS, 0, 3) == 'WIN' )
  7. die("skip Not Valid for Windows");
  8. ?>
  9. --INI--
  10. open_basedir="/tmp"
  11. --FILE--
  12. <?php
  13. $ch = curl_init();
  14. var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
  15. var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/foo"));
  16. var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/xxx/bar"));
  17. curl_close($ch);
  18. ?>
  19. --EXPECTF--
  20. bool(true)
  21. bool(true)
  22. Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948-unix.php on line %d
  23. bool(false)