bug79971_2.phpt 560 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #79971 (special character is breaking the path in xml function)
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('dom')) die('skip dom extension not available');
  6. ?>
  7. --FILE--
  8. <?php
  9. $imp = new DOMImplementation;
  10. if (PHP_OS_FAMILY === 'Windows') {
  11. $path = '/' . str_replace('\\', '/', __DIR__);
  12. } else {
  13. $path = __DIR__;
  14. }
  15. $uri = "file://$path/bug79971_2.xml";
  16. var_dump($imp->createDocumentType("$uri%00foo"));
  17. ?>
  18. --EXPECTF--
  19. Warning: DOMImplementation::createDocumentType(): URI must not contain percent-encoded NUL bytes in %s on line %d
  20. bool(false)