Skip to content

Commit e46e177

Browse files
authored
Merge pull request #207 from derrabus/bugfix/php8-null
Fix PHP 8.1 deprecations
2 parents b363cb3 + e5933c6 commit e46e177

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/HTML5/Parser/DOMTreeBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function __construct($isFragment = false, array $options = array())
175175
// documents, and attempting to up-convert any older DTDs to HTML5.
176176
$dt = $impl->createDocumentType('html');
177177
// $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt);
178-
$this->doc = $impl->createDocument(null, null, $dt);
178+
$this->doc = $impl->createDocument(null, '', $dt);
179179
$this->doc->encoding = !empty($options['encoding']) ? $options['encoding'] : 'UTF-8';
180180
}
181181

@@ -406,6 +406,8 @@ public function startTag($name, $attributes = array(), $selfClosing = false)
406406
$aName = Elements::normalizeMathMlAttribute($aName);
407407
}
408408

409+
$aVal = (string) $aVal;
410+
409411
try {
410412
$prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : false;
411413

0 commit comments

Comments
 (0)