Node.js based forum software built for the modern web
fix: naive checking to handle uploaded images whose filenames end with '-resized'
Julian Lam1268ed50cadb
diff --git a/public/src/client/topic/images.js b/public/src/client/topic/images.jsindex c4c30319d8..5fc2b34f66 100644--- a/public/src/client/topic/images.js+++ b/public/src/client/topic/images.js@@ -19,7 +19,7 @@ define('forum/topic/images', [], function () {}if (!imageEl.parent().is('a')) {- if (utils.isRelativeUrl(src) && suffixRegex.test(src)) {+ if (utils.isRelativeUrl(src) && suffixRegex.test(src) && imageEl.get(0).naturalWidth >= config.resizeImageWidth) {src = src.replace(suffixRegex, '$1');}const alt = imageEl.attr('alt') || '';diff --git a/src/controllers/api.js b/src/controllers/api.jsindex a4d1f34291..c988f501a3 100644--- a/src/controllers/api.js+++ b/src/controllers/api.js@@ -78,6 +78,7 @@ apiController.loadConfig = async function (req) {enablePostHistory: meta.config.enablePostHistory === 1,timeagoCutoff: meta.config.timeagoCutoff !== '' ? Math.max(0, parseInt(meta.config.timeagoCutoff, 10)) : meta.config.timeagoCutoff,timeagoCodes: languages.timeagoCodes,+ resizeImageWidth: meta.config.resizeImageWidth,cookies: {enabled: meta.config.cookieConsentEnabled === 1,message: translator.escape(validator.escape(meta.config.cookieConsentMessage || '[[global:cookies.message]]')).replace(/\\/g, '\\\\'),