bug69111.phpt 815 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Bug #69111 Crash in SessionHandler::read()
  3. --EXTENSIONS--
  4. session
  5. --SKIPIF--
  6. <?php include('skipif.inc'); ?>
  7. --FILE--
  8. <?php
  9. $sh = new SessionHandler;
  10. session_set_save_handler($sh);
  11. $savePath = ini_get('session.save_path');
  12. $sessionName = ini_get('session.name');
  13. // session_start(); // Uncommenting this makes it not crash when reading the session (see below), but it will not return any data.
  14. try {
  15. $sh->open($savePath, $sessionName);
  16. } catch (Error $exception) {
  17. echo $exception->getMessage() . "\n";
  18. }
  19. try {
  20. $sh->write("foo", "bar");
  21. } catch (Error $exception) {
  22. echo $exception->getMessage() . "\n";
  23. }
  24. try {
  25. $sh->read("");
  26. } catch (Error $exception) {
  27. echo $exception->getMessage() . "\n";
  28. }
  29. ?>
  30. --EXPECT--
  31. Session is not active
  32. Session is not active
  33. Session is not active