summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-05-31 23:48:17 +0200
committerDylan William Hardison <dylan@hardison.net>2017-05-31 23:48:38 +0200
commit970190150a40d4bd574a1a84ac640ec44318869e (patch)
tree2b2209df631cbd1361564c68b955ee4a72f59ddb /Bugzilla/Template.pm
parent5d6b04229f82bd33883c4dbc18b6050410aeae33 (diff)
downloadbugzilla-970190150a40d4bd574a1a84ac640ec44318869e.tar.gz
bugzilla-970190150a40d4bd574a1a84ac640ec44318869e.tar.xz
Bug 1365734 - Handle BMO version number in Makefile.PL / MYMETA.json
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 75711e1ef..5bef599d4 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -983,6 +983,21 @@ sub create {
# Function for retrieving global parameters.
'Param' => sub { return Bugzilla->params->{$_[0]}; },
+ 'bugzilla_version' => sub {
+ my $version = Bugzilla->VERSION;
+ if (my @ver = $version =~ /^(\d{4})(\d{2})(\d{2})\.(\d+)$/s) {
+ if ($ver[3] eq '1') {
+ return join('.', @ver[0,1,2]);
+ }
+ else {
+ return join('.', @ver);
+ }
+ }
+ else {
+ return $version;
+ }
+ },
+
json_encode => sub {
return encode_json($_[0]);
},