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