From fc869c1d866d751a04f5c6ebb8970ae633828cdc Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sun, 5 Dec 2010 08:06:29 +0000 Subject: [PATCH] MINOR: Fix to SapphireInfo for git-svn checkouts. (from r112962) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114518 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/SapphireInfo.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/SapphireInfo.php b/dev/SapphireInfo.php index 69dd0e79e..7c8022e59 100644 --- a/dev/SapphireInfo.php +++ b/dev/SapphireInfo.php @@ -22,8 +22,11 @@ class SapphireInfo extends Controller { if(strstr($sapphireVersionFile, "/sapphire/trunk")) { $sapphireVersion = "trunk"; } else { - preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches); - $sapphireVersion = $matches[1]; + if(preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches)) { + $sapphireVersion = $matches[1]; + } else { + $sapphireVersion = "unknown"; + } } return $sapphireVersion;