bug65646_open_basedir_new.phpt 840 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl >= 7.19.4
  3. --INI--
  4. open_basedir=.
  5. --SKIPIF--
  6. <?php
  7. if (!extension_loaded('curl')) exit("skip curl extension not loaded");
  8. if (version_compare(curl_version()['version'], '7.19.4', '<')) exit("skip curl version is too old");
  9. ?>
  10. --FILE--
  11. <?php
  12. $ch = curl_init();
  13. var_dump(curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true));
  14. var_dump(curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_FILE));
  15. var_dump(curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_FILE));
  16. curl_close($ch);
  17. ?>
  18. --EXPECTF--
  19. bool(true)
  20. Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d
  21. bool(false)
  22. Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d
  23. bool(false)