Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 137e31f

Browse files
committed
Silent deprecation triggered by libxml_disable_entity_loader
1 parent cdfa9c2 commit 137e31f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,10 @@ public function validateSchema(\DOMDocument $dom)
634634
EOF
635635
;
636636

637-
if (\LIBXML_VERSION < 20900) {
638-
$disableEntities = libxml_disable_entity_loader(false);
637+
if (\PHP_VERSION_ID < 90000) {
638+
$disableEntities = @libxml_disable_entity_loader(false);
639639
$valid = @$dom->schemaValidateSource($source);
640-
libxml_disable_entity_loader($disableEntities);
640+
@libxml_disable_entity_loader($disableEntities);
641641
} else {
642642
$valid = @$dom->schemaValidateSource($source);
643643
}

src/Symfony/Component/Translation/Util/XliffUtils.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ public static function validateSchema(\DOMDocument $dom): array
6161
{
6262
$xliffVersion = static::getVersionNumber($dom);
6363
$internalErrors = libxml_use_internal_errors(true);
64-
if (\LIBXML_VERSION < 20900) {
65-
$disableEntities = libxml_disable_entity_loader(false);
64+
if (\PHP_VERSION_ID < 90000) {
65+
$disableEntities = @libxml_disable_entity_loader(false);
6666
}
6767

6868
$isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion));
6969
if (!$isValid) {
70-
if (\LIBXML_VERSION < 20900) {
71-
libxml_disable_entity_loader($disableEntities);
70+
if (\PHP_VERSION_ID < 90000) {
71+
@libxml_disable_entity_loader($disableEntities);
7272
}
7373

7474
return self::getXmlErrors($internalErrors);
7575
}
7676

77-
if (\LIBXML_VERSION < 20900) {
78-
libxml_disable_entity_loader($disableEntities);
77+
if (\PHP_VERSION_ID < 90000) {
78+
@libxml_disable_entity_loader($disableEntities);
7979
}
8080

8181
$dom->normalizeDocument();

0 commit comments

Comments
 (0)