diff options
author | Asmir Mustafic <[email protected]> | 2020-02-06 12:39:04 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-06 12:39:04 +0100 |
commit | a3edfe52f9e7380e498d33157e1330e85386645d (patch) | |
tree | a5a561c60b9697dfbb1b1983b4356aa3cca63924 /test/HTML5/Parser | |
parent | 114b913526b717e6002251a9592974a5502ba6c7 (diff) | |
parent | 21eeaf0a6044318c0fe42e4487e84dcb853af490 (diff) |
Merge pull request #178 from Masterminds/eof-entity
Prevent infinite loop on un-terminated entity declaration at EOF
Diffstat (limited to 'test/HTML5/Parser')
-rw-r--r-- | test/HTML5/Parser/DOMTreeBuilderTest.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php index b5940c2..00e9a47 100644 --- a/test/HTML5/Parser/DOMTreeBuilderTest.php +++ b/test/HTML5/Parser/DOMTreeBuilderTest.php @@ -133,6 +133,14 @@ class DOMTreeBuilderTest extends \Masterminds\HTML5\Tests\TestCase </html>', $doc->saveXML()); } + public function testEntityAtEndOfFile() + { + $fragment = $this->parseFragment('&#'); + $this->assertInstanceOf('DOMDocumentFragment', $fragment); + $this->assertSame('&#', $fragment->textContent); + $this->assertEquals('Line 1, Col 2: Expected &#DEC; &#HEX;, got EOF', $this->errors[0]); + } + public function testStrangeCapitalization() { $html = '<!doctype html> |