Skip to content

Commit

Permalink
Merge pull request #207 from derrabus/bugfix/php8-null
Browse files Browse the repository at this point in the history
Fix PHP 8.1 deprecations
  • Loading branch information
goetas authored Jun 10, 2021
2 parents b363cb3 + e5933c6 commit e46e177
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/HTML5/Parser/DOMTreeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function __construct($isFragment = false, array $options = array())
// documents, and attempting to up-convert any older DTDs to HTML5.
$dt = $impl->createDocumentType('html');
// $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt);
$this->doc = $impl->createDocument(null, null, $dt);
$this->doc = $impl->createDocument(null, '', $dt);
$this->doc->encoding = !empty($options['encoding']) ? $options['encoding'] : 'UTF-8';
}

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

$aVal = (string) $aVal;

try {
$prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : false;

Expand Down

0 comments on commit e46e177

Please sign in to comment.