mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-04 04:22:53 +02:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user