From 3a16a1117999fa5bc701fd2c8d204930f3f54838 Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Wed, 17 May 2023 17:12:24 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20issue=20where=20single?= =?UTF-8?q?=20letter=20slugs=20for=20products=20would=20cause=20500=20erro?= =?UTF-8?q?rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Team/issues/3224 When a product has a slug that is a single letter, checking if a user had access to view a post associated with that product would cause a 500 error. The underlying cause of this issue is https://github.com/TryGhost/NQL/issues/20 This fix circumvents this issue by providing a value that the nql lexer will not error out on --- ghost/core/core/server/services/members/content-gating.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/core/core/server/services/members/content-gating.js b/ghost/core/core/server/services/members/content-gating.js index 6a63a455211f..69e153475eeb 100644 --- a/ghost/core/core/server/services/members/content-gating.js +++ b/ghost/core/core/server/services/members/content-gating.js @@ -46,7 +46,7 @@ function checkPostAccess(post, member) { return BLOCK_ACCESS; } visibility = post.tiers.map((product) => { - return `product:${product.slug}`; + return `product:'${product.slug}'`; }).join(','); }