From 4e4d80b7bbee53fb120e7da8fc276826a04b2d58 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 29 Mar 2018 01:30:47 +0200 Subject: [PATCH] [lib.channel-controller] fix dump() to clear list before updating --- webpack/lib/channel-controller.js | 6 +++--- webpack/lib/room-controller.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webpack/lib/channel-controller.js b/webpack/lib/channel-controller.js index 7a994d9..755fca9 100644 --- a/webpack/lib/channel-controller.js +++ b/webpack/lib/channel-controller.js @@ -69,7 +69,7 @@ export default class ChannelController{ return false; /* (2) Clear list () */ - this.list.splice(); + this.list.splice(0); /* (3) Apply new channels */ for(let c of channels){ @@ -201,11 +201,11 @@ export default class ChannelController{ create(name=null, link=null){ /* (1) Manage invalid @link */ - if( typeof link !== 'string' || /^[a-z0-9-]$/i.test(link) ) + if( typeof link !== 'string' ) return false; /* (2) Manage invalid @name */ - if( typeof name !== 'string' || !/^[a-z0-9\/_-]{3,}$/i.test(name) ) + if( typeof name !== 'string' ) return false; /* (3) Try to create room in API */ diff --git a/webpack/lib/room-controller.js b/webpack/lib/room-controller.js index f1a7db0..5a4e2e6 100644 --- a/webpack/lib/room-controller.js +++ b/webpack/lib/room-controller.js @@ -223,7 +223,7 @@ export default class RoomController{ return false; /* (2) Manage invalid @name */ - if( typeof name !== 'string' || !/^[a-z0-9\/_-]{3,}$/i.test(name) ) + if( typeof name !== 'string' ) return false; /* (3) Try to create room in API */