facebook / facebook/hhvm

DOMDocument::saveHtml() generates element without name

Open
#7,168 1 comment 0 reactions 0 assignees View on GitHub
php5 incompatibility php7 incompatibility probably easy
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

If `DOMDocument::saveHtml()` is called with an instance of `DOMDocumentFragment` as the argument it generates an invalid element node without a tag name for the fragment node.
### HHVM Version

hhvm-3.9.1 - 3.12.0
### Standalone code, or other way to reproduce the problem

``` php
$document = new DOMDocument();
$fragment = $document->createDocumentFragment();
$fragment->appendChild($document->createElement('em', 'test'));
$fragment->appendChild($document->createTextNode('test'));

echo $document->saveHtml($fragment);
```
### Expected result

``` html
testtest
```
### Actual result

``` html
<>testtest
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.