From 90bc78d0be75838680241438b1fa9548a726ffc1 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Wed, 24 Nov 2021 18:18:22 +0530 Subject: [PATCH 1/2] Updated name validation for offer to restrict to 40 chars refs https://github.com/TryGhost/Team/issues/1236 Stripe allows coupon names to be only upto 40 chars long, while Ghost allowed them to be 191 chars. This change updates the admin validation to restrict name to 40 chars to match Stripe limit --- ghost/admin/app/validators/offer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/validators/offer.js b/ghost/admin/app/validators/offer.js index e3d44e0deb..09563fab8c 100644 --- a/ghost/admin/app/validators/offer.js +++ b/ghost/admin/app/validators/offer.js @@ -9,8 +9,8 @@ export default BaseValidator.create({ model.errors.add('name', 'Please enter a name.'); this.invalidate(); } - if (!validator.isLength(model.name || '', 0, 191)) { - model.errors.add('name', 'Name cannot be longer than 191 characters.'); + if (!validator.isLength(model.name || '', 0, 40)) { + model.errors.add('name', 'Name cannot be longer than 40 characters.'); this.invalidate(); } }, From 68372746a681f52214300ebc1bedf5e1fad5e91d Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 25 Nov 2021 11:16:29 +0000 Subject: [PATCH 2/2] v4.23.0 --- ghost/admin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 76e9d55787..79f19098c9 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "4.22.4", + "version": "4.23.0", "description": "Ember.js admin client for Ghost", "author": "Ghost Foundation", "homepage": "http://ghost.org",