Skip to content

Node.js based forum software built for the modern web

only add relative path if not starts with http(s)

Barış Soner Uşaklıf7ccabc3cc3e
diff --git a/public/src/client/account/header.js b/public/src/client/account/header.js
index 985cd7c82c..1ecacc812d 100644
--- a/public/src/client/account/header.js
+++ b/public/src/client/account/header.js
@@ -93,7 +93,8 @@ define('forum/account/header', [
paramValue: ajaxify.data.theirid,
accept: '.png,.jpg,.bmp',
}, function (imageUrlOnServer) {
- components.get('account/cover').css('background-image', 'url(' + config.relative_path + imageUrlOnServer + '?' + config['cache-buster'] + ')');
+ imageUrlOnServer = (!imageUrlOnServer.startsWith('http') ? config.relative_path : '') + imageUrlOnServer + '?' + Date.now();
+ components.get('account/cover').css('background-image', 'url(' + imageUrlOnServer + ')');
});
},
removeCover