mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/9871] Restore phpbb_version_compare
PHPBB3-9871
This commit is contained in:
parent
8748032866
commit
43074a1b69
2 changed files with 11 additions and 15 deletions
|
@ -429,11 +429,17 @@ function phpbb_email_hash($email)
|
|||
*/
|
||||
function phpbb_version_compare($version1, $version2, $operator = null)
|
||||
{
|
||||
global $phpbb_container;
|
||||
$version1 = strtolower($version1);
|
||||
$version2 = strtolower($version2);
|
||||
|
||||
$version_helper = $phpbb_container->get('version_helper');
|
||||
|
||||
return $version_helper->compare($version1, $version2, $operator);
|
||||
if (is_null($operator))
|
||||
{
|
||||
return version_compare($version1, $version2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return version_compare($version1, $version2, $operator);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,17 +40,7 @@ class version_helper
|
|||
*/
|
||||
public function compare($version1, $version2, $operator = null)
|
||||
{
|
||||
$version1 = strtolower($version1);
|
||||
$version2 = strtolower($version2);
|
||||
|
||||
if (is_null($operator))
|
||||
{
|
||||
return version_compare($version1, $version2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return version_compare($version1, $version2, $operator);
|
||||
}
|
||||
return phpbb_version_compare($version1, $version2, $operator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue