From f7ccabc3cc3e6209e46a521a48d36404b925b182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 7 Nov 2017 11:10:53 -0500 Subject: [PATCH] only add relative path if not starts with http(s) --- public/src/client/account/header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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