mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Improved reliability of LeftAndMain->CMSVersion() - not failing on empty $URL$ placeholder with subversion path to determine version numbers
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@66274 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
45c4d670b6
commit
6a21094048
@ -812,7 +812,11 @@ JS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the version number of this application
|
||||
* Return the version number of this application.
|
||||
* Uses the subversion path information in <mymodule>/silverstripe_version
|
||||
* (automacially replaced $URL$ placeholder).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function CMSVersion() {
|
||||
$sapphireVersionFile = file_get_contents('../sapphire/silverstripe_version');
|
||||
@ -823,21 +827,21 @@ JS;
|
||||
$sapphireVersion = "trunk";
|
||||
} else {
|
||||
preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches);
|
||||
$sapphireVersion = $matches[1];
|
||||
$sapphireVersion = ($matches) ? $matches[1] : null;
|
||||
}
|
||||
|
||||
if(strstr($jspartyVersionFile, "/jsparty/trunk")) {
|
||||
$jspartyVersion = "trunk";
|
||||
} else {
|
||||
preg_match("/jsparty\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $jspartyVersionFile, $matches);
|
||||
$jspartyVersion = $matches[1];
|
||||
$jspartyVersion = ($matches) ? $matches[1] : null;
|
||||
}
|
||||
|
||||
if(strstr($cmsVersionFile, "/cms/trunk")) {
|
||||
$cmsVersion = "trunk";
|
||||
} else {
|
||||
preg_match("/cms\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $cmsVersionFile, $matches);
|
||||
$cmsVersion = $matches[1];
|
||||
$cmsVersion = ($matches) ? $matches[1] : null;
|
||||
}
|
||||
|
||||
if($sapphireVersion == $jspartyVersion && $jspartyVersion == $cmsVersion) {
|
||||
|
Loading…
Reference in New Issue
Block a user