open_basedir_realpath.phpt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --TEST--
  2. Test open_basedir configuration
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) != 'WIN') {
  6. die('skip only run on Windows');
  7. }
  8. ?>
  9. --INI--
  10. open_basedir=.
  11. --FILE--
  12. <?php
  13. require_once "open_basedir.inc";
  14. test_open_basedir("realpath");
  15. ?>
  16. --CLEAN--
  17. <?php
  18. require_once "open_basedir.inc";
  19. delete_directories();
  20. ?>
  21. --EXPECTF--
  22. *** Testing open_basedir configuration [realpath] ***
  23. bool(true)
  24. bool(true)
  25. bool(true)
  26. bool(true)
  27. bool(true)
  28. Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d
  29. bool(false)
  30. Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d
  31. bool(false)
  32. Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d
  33. bool(false)
  34. Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d
  35. bool(false)
  36. Warning: realpath(): open_basedir restriction in effect. File(%s\) is not within the allowed path(s): (.) in %s on line %d
  37. bool(false)
  38. Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d
  39. bool(false)
  40. Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d
  41. bool(false)
  42. Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d
  43. bool(false)
  44. Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d
  45. bool(false)
  46. string(%d) "%s\test\ok"
  47. string(%d) "%s\test\ok\ok.txt"
  48. string(%d) "%s\test\ok\ok.txt"
  49. string(%d) "%s\test\ok\ok.txt"
  50. string(%d) "%s\test\ok\ok.txt"
  51. *** Finished testing open_basedir configuration [realpath] ***