diff --git a/include/functions.inc.php b/include/functions.inc.php index 1a2fc2f5e..c9124e70e 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -2085,14 +2085,17 @@ function get_privacy_level_options() /** - * return the branch from the version. For example version 2.2.4 is for branch 2.2 + * return the branch from the version. For example version 11.1.2 is on branch 11 * * @param string $version * @return string */ function get_branch_from_version($version) { - return implode('.', array_slice(explode('.', $version), 0, 2)); + // the algorithm is a bit complicated to just retrieve the first digits before + // the first ".". It's because before version 11.0.0, we used to take the 2 first + // digits, ie version 2.2.4 was on branch 2.2 + return implode('.', array_slice(explode('.', $version), 0, 1)); } /**