mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-28 22:31:04 +02:00
Merge branch 'master' of https://github.com/NodeBB/NodeBB
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user