WebModuleRequirement: Strip leading `v` from a module's version

This commit is contained in:
Johannes Meyer 2020-05-05 16:26:39 +02:00
parent 43cb5f587a
commit 335dde7b68
1 changed files with 8 additions and 2 deletions

View File

@ -19,7 +19,13 @@ class WebModuleRequirement extends Requirement
}
$module = $mm->getModule($name, false);
$this->setStateText(sprintf(mt('setup', '%s version: %s'), $this->getAlias(), $module->getVersion()));
return version_compare($module->getVersion(), $version, $op);
$moduleVersion = $module->getVersion();
if ($moduleVersion[0] === 'v') {
$moduleVersion = substr($moduleVersion, 1);
}
$this->setStateText(sprintf(mt('setup', '%s version: %s'), $this->getAlias(), $moduleVersion));
return version_compare($moduleVersion, $version, $op);
}
}