fix PHP 8.0 compatibility
This commit is contained in:
parent
67b15986a7
commit
681d5c4709
|
|
@ -72,10 +72,14 @@ class XMLReader
|
|||
*/
|
||||
public function getDomFromString($content)
|
||||
{
|
||||
$originalLibXMLEntityValue = libxml_disable_entity_loader(true);
|
||||
if (\PHP_VERSION_ID < 80000) {
|
||||
$originalLibXMLEntityValue = libxml_disable_entity_loader(true);
|
||||
}
|
||||
$this->dom = new \DOMDocument();
|
||||
$this->dom->loadXML($content);
|
||||
libxml_disable_entity_loader($originalLibXMLEntityValue);
|
||||
if (\PHP_VERSION_ID < 80000) {
|
||||
libxml_disable_entity_loader($originalLibXMLEntityValue);
|
||||
}
|
||||
|
||||
return $this->dom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue