diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-12-20 08:53:48 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-12-20 08:53:48 +0100 |
commit | a079269166d120bcbcb33d34f4b1c8f60d102e32 (patch) | |
tree | c3ae8596608e94e58ab1624ef78b8ef33c5323a0 /program | |
parent | a8ffab3f4ff54af41c9041a30eb989954d6ffc17 (diff) |
Fix version comparisons with -stable suffix (#1488876)
Diffstat (limited to 'program')
-rw-r--r-- | program/lib/Roundcube/bootstrap.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 18c07ddab..530a7f855 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -358,6 +358,22 @@ function format_email($email) /** + * Fix version number so it can be used correctly in version_compare() + * + * @param string $version Version number string + * + * @param return Version number string + */ +function version_parse($version) +{ + return str_replace( + array('-stable', '-git'), + array('.0', '.99'), + $version); +} + + +/** * mbstring replacement functions */ if (!extension_loaded('mbstring')) |