From 59fb3d2e33cfefb7bf631e93872161074ff90080 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Fri, 5 May 2017 08:52:03 -0500 Subject: [PATCH] fix(ls): don't allow dots in process name closes #184 - tighten up pname validation regex - replace dots with dashes in default pname --- lib/commands/config/advanced.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands/config/advanced.js b/lib/commands/config/advanced.js index aa2cd87ca..dbf66a462 100644 --- a/lib/commands/config/advanced.js +++ b/lib/commands/config/advanced.js @@ -31,10 +31,10 @@ module.exports = [{ }, { name: 'pname', description: 'Name of the Ghost instance', - validate: value => !!value.match(/[A-Za-z0-9:\.\-_]+/) || - 'Invalid process name. Process name can contain alphanumeric characters,' + - 'and the special characters \'.\', \'-\', and \'_\'', - default: config => url.parse(config.get('url')).hostname + validate: value => !!value.match(/^[A-Za-z0-9\-_]+$/) || + 'Invalid process name. Process name can contain alphanumeric characters ' + + 'and the special characters \'-\' and \'_\'', + default: config => url.parse(config.get('url')).hostname.replace(/\./g, '-') }, { name: 'port', description: 'Port ghost should listen on',