improve Admin.php

This commit is contained in:
binsky 2021-03-23 00:25:45 +01:00
parent 9d47d0f28d
commit eddef5af57

View file

@ -60,7 +60,7 @@ class Admin implements ISettings {
// get latest master version // get latest master version
$version = false; $version = false;
$url = 'https://raw.githubusercontent.com/nextcloud/passman/master/appinfo/info.xml'; $url = 'https://raw.githubusercontent.com/nextcloud/passman/dist/appinfo/info.xml';
try { try {
$httpClient = new Client(); $httpClient = new Client();
$response = $httpClient->request('get', $url); $response = $httpClient->request('get', $url);
@ -70,12 +70,12 @@ class Admin implements ISettings {
} }
if ($xml) { if ($xml) {
$data = @simplexml_load_string($xml); $data = simplexml_load_string($xml);
// libxml_disable_entity_loader is deprecated with php8, the vulnerability is disabled by default by libxml with php8 // libxml_disable_entity_loader is deprecated with php8, the vulnerability is disabled by default by libxml with php8
if (\PHP_VERSION_ID < 80000) { if (\PHP_VERSION_ID < 80000) {
$loadEntities = libxml_disable_entity_loader(true); $loadEntities = libxml_disable_entity_loader(true);
$data = @simplexml_load_string($xml); $data = simplexml_load_string($xml);
libxml_disable_entity_loader($loadEntities); libxml_disable_entity_loader($loadEntities);
} }