diff --git a/install/package.json b/install/package.json index c43195f359..03700a76ed 100644 --- a/install/package.json +++ b/install/package.json @@ -103,7 +103,7 @@ "nodebb-plugin-spam-be-gone": "0.7.6", "nodebb-rewards-essentials": "0.1.4", "nodebb-theme-lavender": "5.0.14", - "nodebb-theme-persona": "10.2.84", + "nodebb-theme-persona": "10.2.85", "nodebb-theme-slick": "1.3.3", "nodebb-theme-vanilla": "11.3.4", "nodebb-widget-essentials": "4.1.2", diff --git a/src/topics/thumb.js b/src/topics/thumb.js index 1423e3382e..15574779e6 100644 --- a/src/topics/thumb.js +++ b/src/topics/thumb.js @@ -23,6 +23,11 @@ module.exports = function (Topics) { const pipeToFileAsync = util.promisify(pipeToFile); Topics.resizeAndUploadThumb = async function (data) { + // Handle protocol-relative URLs + if (data.thumb && data.thumb.startsWith('//')) { + data.thumb = `${nconf.get('secure') ? 'https' : 'http'}:${data.thumb}`; + } + // Only continue if passed in thumbnail exists and is a URL. A system path means an upload is not necessary. if (!data.thumb || !validator.isURL(data.thumb)) { return;