mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-02 20:59:56 +01:00
improve regex for unwanted whitespace in cover:url
This commit is contained in:
@@ -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;
|
||||
module.exports = coverPhoto;
|
||||
|
||||
Reference in New Issue
Block a user