open_basedir_is_executable.phpt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --TEST--
  2. Test open_basedir configuration
  3. --INI--
  4. open_basedir=.
  5. --FILE--
  6. <?php
  7. require_once "open_basedir.inc";
  8. $initdir = getcwd();
  9. test_open_basedir_before("is_executable");
  10. test_open_basedir_error("is_executable");
  11. var_dump(is_executable("ok.txt"));
  12. var_dump(is_executable("../ok/ok.txt"));
  13. var_dump(is_executable($initdir."/test/ok/ok.txt"));
  14. var_dump(is_executable($initdir."/test/ok/../ok/ok.txt"));
  15. test_open_basedir_after("is_executable");
  16. ?>
  17. --CLEAN--
  18. <?php
  19. require_once "open_basedir.inc";
  20. delete_directories();
  21. ?>
  22. --EXPECTF--
  23. *** Testing open_basedir configuration [is_executable] ***
  24. bool(true)
  25. bool(true)
  26. bool(true)
  27. bool(true)
  28. bool(true)
  29. Warning: is_executable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
  30. bool(false)
  31. Warning: is_executable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  32. bool(false)
  33. Warning: is_executable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
  34. bool(false)
  35. Warning: is_executable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
  36. bool(false)
  37. Warning: is_executable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
  38. bool(false)
  39. Warning: is_executable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
  40. bool(false)
  41. Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  42. bool(false)
  43. Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  44. bool(false)
  45. bool(false)
  46. bool(false)
  47. bool(false)
  48. bool(false)
  49. *** Finished testing open_basedir configuration [is_executable] ***