The branch is now only the first digits before the first dot in version number.

In order to change from versions 2.10.x to 11.x.y, Piwigo needs to only consider 11 as the branch, and not 11.x. Or else it will mess up with minor and major updates.
This commit is contained in:
plegall
2020-11-10 12:14:56 +01:00
parent 1997f311f4
commit 28ea5a0ff4

View File

@@ -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));
}
/**