curl_file_serialize.phpt 545 B

123456789101112131415161718192021
  1. --TEST--
  2. CURL file uploading
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("curl")) {
  6. exit("skip curl extension not loaded");
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. $data = 'a:2:{s:4:"file";O:8:"CURLFile":3:{s:4:"name";s:13:"testdata1.txt";s:4:"mime";s:0:"";s:8:"postname";s:0:"";}s:4:"data";s:3:"foo";}';
  12. var_dump(unserialize($data));
  13. ?>
  14. --EXPECTF--
  15. Fatal error: Uncaught exception 'Exception' with message 'Unserialization of CURLFile instances is not allowed' in %s
  16. Stack trace:
  17. #0 [internal function]: CURLFile->__wakeup()
  18. #1 %s
  19. #2 {main}
  20. thrown in %s on line %d