Skip to content

Commit d6c6800

Browse files
authored
Merge pull request #612 from nextcloud/improve-xml-loaded-version-handling
libxml - compare against loaded version
2 parents 9ebd091 + 740349f commit d6c6800

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/private/legacy/util.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,15 @@ public static function checkServer(\OCP\IConfig $config) {
833833
}
834834

835835
if(function_exists('xml_parser_create') &&
836-
version_compare('2.7.0', LIBXML_DOTTED_VERSION) === 1) {
836+
LIBXML_LOADED_VERSION < 20700 ) {
837+
$version = LIBXML_LOADED_VERSION;
838+
$major = floor($version/10000);
839+
$version -= ($major * 10000);
840+
$minor = floor($version/100);
841+
$version -= ($minor * 100);
842+
$patch = $version;
837843
$errors[] = array(
838-
'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [LIBXML_DOTTED_VERSION]),
844+
'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]),
839845
'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.')
840846
);
841847
}

0 commit comments

Comments
 (0)