open_basedir_realpath.phpt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. Test open_basedir configuration
  3. --SKIPIF--
  4. <?php
  5. if(PHP_OS_FAMILY !== "Windows") {
  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] ***