From 5e09a14acc22639dee25040a696d997f7bdb5544 Mon Sep 17 00:00:00 2001
From: Dag
Date: Sun, 4 Sep 2022 07:21:57 +0200
Subject: [PATCH] fix: include git tag in version (#3000)
Also include os and php version in github issue template.
---
actions/DisplayAction.php | 2 +-
lib/Configuration.php | 2 +-
templates/bridge-error.html.php | 8 +++++++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/actions/DisplayAction.php b/actions/DisplayAction.php
index e953b1c1..318c7b09 100644
--- a/actions/DisplayAction.php
+++ b/actions/DisplayAction.php
@@ -222,7 +222,7 @@ class DisplayAction implements ActionInterface
return sprintf('https://github.com/RSS-Bridge/rss-bridge/issues/new?%s', http_build_query([
'title' => sprintf('%s failed with error %s', $bridge->getName(), $e->getCode()),
'body' => sprintf(
- "```\n%s\n\n%s\n\nQuery string:%s\nVersion:%s\nOs:%s\nPHP version:%s\n```",
+ "```\n%s\n\n%s\n\nQuery string: %s\nVersion: %s\nOs: %s\nPHP version: %s\n```",
$message,
implode("\n", create_sane_stacktrace($e)),
$_SERVER['QUERY_STRING'] ?? '',
diff --git a/lib/Configuration.php b/lib/Configuration.php
index 3c6be630..623f469d 100644
--- a/lib/Configuration.php
+++ b/lib/Configuration.php
@@ -194,7 +194,7 @@ final class Configuration
if (isset($parts[3])) {
$branchName = $parts[3];
if (file_exists($revisionHashFile)) {
- return 'git.' . $branchName . '.' . substr(file_get_contents($revisionHashFile), 0, 7);
+ return sprintf('%s (git.%s.%s)', self::VERSION, $branchName, substr(file_get_contents($revisionHashFile), 0, 7));
}
}
}
diff --git a/templates/bridge-error.html.php b/templates/bridge-error.html.php
index 51711c9f..517dc52a 100644
--- a/templates/bridge-error.html.php
+++ b/templates/bridge-error.html.php
@@ -18,7 +18,13 @@
Query string: = e($_SERVER['QUERY_STRING'] ?? '') ?>
- Version: = e(Configuration::getVersion()) ?>
+ Version: = raw(Configuration::getVersion()) ?>
+
+
+ OS: = raw(PHP_OS_FAMILY) ?>
+
+
+ PHP version: = raw(phpversion() ?: 'Unknown'()) ?>