mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
Avoid deprecation warnings about libxml_disable_entity_loader in PHP 8.1
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
ec4fff20e8
commit
c3a1a66eae
2 changed files with 14 additions and 6 deletions
|
|
@ -138,9 +138,13 @@ class ChangesCheck {
|
|||
protected function extractData($body):array {
|
||||
$data = [];
|
||||
if ($body) {
|
||||
$loadEntities = libxml_disable_entity_loader(true);
|
||||
$xml = @simplexml_load_string($body);
|
||||
libxml_disable_entity_loader($loadEntities);
|
||||
if (\LIBXML_VERSION < 20900) {
|
||||
$loadEntities = libxml_disable_entity_loader(true);
|
||||
$xml = @simplexml_load_string($body);
|
||||
libxml_disable_entity_loader($loadEntities);
|
||||
} else {
|
||||
$xml = @simplexml_load_string($body);
|
||||
}
|
||||
if ($xml !== false) {
|
||||
$data['changelogURL'] = (string)$xml->changelog['href'];
|
||||
$data['whatsNew'] = [];
|
||||
|
|
|
|||
|
|
@ -95,9 +95,13 @@ class VersionCheck {
|
|||
}
|
||||
|
||||
if ($xml) {
|
||||
$loadEntities = libxml_disable_entity_loader(true);
|
||||
$data = @simplexml_load_string($xml);
|
||||
libxml_disable_entity_loader($loadEntities);
|
||||
if (\LIBXML_VERSION < 20900) {
|
||||
$loadEntities = libxml_disable_entity_loader(true);
|
||||
$data = @simplexml_load_string($xml);
|
||||
libxml_disable_entity_loader($loadEntities);
|
||||
} else {
|
||||
$data = @simplexml_load_string($xml);
|
||||
}
|
||||
if ($data !== false) {
|
||||
$tmp['version'] = (string)$data->version;
|
||||
$tmp['versionstring'] = (string)$data->versionstring;
|
||||
|
|
|
|||
Loading…
Reference in a new issue