From e2b30d6329ad293a9cb8bb202df74fb1e7c3497f Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 26 Jan 2017 18:04:51 -0500 Subject: [PATCH] improve regex for unwanted whitespace in cover:url --- src/coverPhoto.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coverPhoto.js b/src/coverPhoto.js index 699e4ee374..7965f310ea 100644 --- a/src/coverPhoto.js +++ b/src/coverPhoto.js @@ -15,7 +15,7 @@ coverPhoto.getDefaultProfileCover = function (uid) { function getCover(type, id) { if (meta.config[type + ':defaultCovers']) { - var covers = meta.config[type + ':defaultCovers'].split(/\s*?,\s*?/g); + var covers = meta.config[type + ':defaultCovers'].trim().split(/[\s,]+/g); if (typeof id === 'string') { id = (id.charCodeAt(0) + id.charCodeAt(1)) % covers.length; @@ -29,4 +29,4 @@ function getCover(type, id) { return nconf.get('relative_path') + '/images/cover-default.png'; } -module.exports = coverPhoto; \ No newline at end of file +module.exports = coverPhoto;