mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Prior to this patch there was a common read handler, and it relied on the dom class set in the intern document. However, Dom\Implementation allows creating DTDs unassociated with a document, so we can't rely on an intern document and the check fails. This causes the ZVAL_NULL() path to be taken. To solve this, just split the handler. Closes GH-21082.
29 lines
577 B
PHP
29 lines
577 B
PHP
--TEST--
|
|
GH-21077 (Accessing Dom\Node::baseURI can throw TypeError)
|
|
--EXTENSIONS--
|
|
dom
|
|
--CREDITS--
|
|
mbeccati
|
|
--FILE--
|
|
<?php
|
|
|
|
$implementation = new Dom\Implementation();
|
|
$node = $implementation->createDocumentType('html', 'publicId', 'systemId');
|
|
|
|
var_dump($node->baseURI);
|
|
|
|
$dom = Dom\XMLDocument::createEmpty();
|
|
$dom->append($node = $dom->importNode($node));
|
|
|
|
var_dump($dom->saveXML());
|
|
|
|
var_dump($node->baseURI);
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(11) "about:blank"
|
|
string(84) "<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "publicId" "systemId">
|
|
"
|
|
string(11) "about:blank"
|