From 1d06439633641447b7b5b0fd470581d3e7dcd4f1 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 9 Aug 2022 08:30:02 +0200 Subject: [PATCH] Prevented linking to GitHub for pre-releases - if we're running a pre-release, we haven't released it on GitHub so Admin shouldn't provide a link to it - instead of pulling in `semver`, I've just gone for the simpler method of looking for the pre-release string identifier --- ghost/admin/app/controllers/whatsnew.js | 6 ++++++ ghost/admin/app/templates/whatsnew.hbs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ghost/admin/app/controllers/whatsnew.js b/ghost/admin/app/controllers/whatsnew.js index 087c904533..7527fc4027 100644 --- a/ghost/admin/app/controllers/whatsnew.js +++ b/ghost/admin/app/controllers/whatsnew.js @@ -13,6 +13,12 @@ export default class WhatsNewController extends Controller { return date.getFullYear(); } + get linkToGitHubReleases() { + // Don't link to GitHub Releases if the version contains the + // pre-release identifier + return !this.config.get('version').includes('-pre.'); + } + get showSystemInfo() { const isPro = !!this.config.get('hostSettings')?.siteId; diff --git a/ghost/admin/app/templates/whatsnew.hbs b/ghost/admin/app/templates/whatsnew.hbs index 862142ff74..18f9d2e73e 100644 --- a/ghost/admin/app/templates/whatsnew.hbs +++ b/ghost/admin/app/templates/whatsnew.hbs @@ -50,7 +50,11 @@ {{/if}}