@ -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",
@ -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;