From 1bb9d4ff005967d6b5567ee657826649f5a16a20 Mon Sep 17 00:00:00 2001 From: Aileen Nowak Date: Thu, 16 Nov 2017 20:58:22 +0800 Subject: [PATCH] Set soft limits for blog title and description (#9250) refs #8143 Add max length validations to settings: - `blog.title`: 150 chars - `blog.description`: 200 chars The `validateSettings` fn in our validations checks for existing `validations` properties in our `default-settings.json` file, similar to other tables in our `schema.js`. --- core/server/data/schema/default-settings.json | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/server/data/schema/default-settings.json b/core/server/data/schema/default-settings.json index 1823afb060..e04b3d6027 100644 --- a/core/server/data/schema/default-settings.json +++ b/core/server/data/schema/default-settings.json @@ -15,10 +15,20 @@ }, "blog": { "title": { - "defaultValue": "Ghost" + "defaultValue": "Ghost", + "validations": { + "isLength": { + "max": 150 + } + } }, "description": { - "defaultValue": "The professional publishing platform" + "defaultValue": "The professional publishing platform", + "validations": { + "isLength": { + "max": 200 + } + } }, "logo": { "defaultValue": "https://casper.ghost.org/v1.0.0/images/ghost-logo.svg"