mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
fix: naive checking to handle uploaded images whose filenames end with '-resized'
This commit is contained in:
@@ -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') || '';
|
||||
|
||||
@@ -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, '\\\\'),
|
||||
|
||||
Reference in New Issue
Block a user