Node.js based forum software built for the modern web
fix: let administrators bypass post length limits in quick reply (#14399)
palmoni5909a6b366a70
diff --git a/public/src/modules/quickreply.js b/public/src/modules/quickreply.jsindex 3a9573fb7b..1278397325 100644--- a/public/src/modules/quickreply.js+++ b/public/src/modules/quickreply.js@@ -89,11 +89,14 @@ define('quickreply', [...opts.body,};- const replyLen = replyMsg.length;- if (replyLen < parseInt(config.minimumPostLength, 10)) {- return alerts.error('[[error:content-too-short, ' + config.minimumPostLength + ']]');- } else if (replyLen > parseInt(config.maximumPostLength, 10)) {- return alerts.error('[[error:content-too-long, ' + config.maximumPostLength + ']]');+ // Administrators bypass post length limits (mirrors server-side check in src/topics/create.js)+ if (!app.user.isAdmin) {+ const replyLen = replyMsg.length;+ if (replyLen < parseInt(config.minimumPostLength, 10)) {+ return alerts.error('[[error:content-too-short, ' + config.minimumPostLength + ']]');+ } else if (replyLen > parseInt(config.maximumPostLength, 10)) {+ return alerts.error('[[error:content-too-long, ' + config.maximumPostLength + ']]');+ }}ready = false;