Skip to content

Commit

Permalink
🐛 Fixed issue where single letter slugs for products would cause 500 …
Browse files Browse the repository at this point in the history
…errors

refs TryGhost/Product#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 TryGhost/NQL#20
This fix circumvents this issue by providing a value that the nql lexer
will not error out on
  • Loading branch information
mike182uk committed May 17, 2023
1 parent f58b9d3 commit 3a16a11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ghost/core/core/server/services/members/content-gating.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(',');
}

Expand Down

0 comments on commit 3a16a11

Please sign in to comment.