bug76359.phpt 479 B

12345678910111213141516171819
  1. --TEST--
  2. Bug #76359 (open_basedir bypass through adding "..")
  3. --FILE--
  4. <?php
  5. ini_set('open_basedir', __DIR__);
  6. mkdir(__DIR__ . "/bug76359");
  7. chdir(__DIR__ . "/bug76359");
  8. var_dump(ini_set('open_basedir', ini_get('open_basedir') . PATH_SEPARATOR . ".."));
  9. chdir("..");
  10. chdir("..");
  11. ?>
  12. --EXPECTF--
  13. bool(false)
  14. Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (%s) in %s on line %d
  15. --CLEAN--
  16. <?php
  17. @rmdir(__DIR__ . "/bug76359");
  18. ?>