fix PHP 8.0 compatibility

This commit is contained in:
Libor M 2021-01-02 09:08:43 +01:00
parent 67b15986a7
commit 681d5c4709
2 changed files with 6 additions and 3 deletions

View File

@ -72,10 +72,14 @@ class XMLReader
*/
public function getDomFromString($content)
{
if (\PHP_VERSION_ID < 80000) {
$originalLibXMLEntityValue = libxml_disable_entity_loader(true);
}
$this->dom = new \DOMDocument();
$this->dom->loadXML($content);
if (\PHP_VERSION_ID < 80000) {
libxml_disable_entity_loader($originalLibXMLEntityValue);
}
return $this->dom;
}

View File

@ -66,7 +66,6 @@ class XMLWriterTest extends \PHPUnit\Framework\TestCase
setlocale(LC_NUMERIC, 'de_DE.UTF-8', 'de');
$this->assertSame('1,2', (string)$value);
$this->assertSame('<element name="1.2"/>' . chr(10), $xmlWriter->getData());
setlocale(LC_NUMERIC, $currentLocale);