mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: style, no need to convert length to string
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = function (Messaging) {
|
||||
|
||||
const maximumChatMessageLength = meta.config.maximumChatMessageLength || 1000;
|
||||
content = String(content).trim();
|
||||
let length = String(content.length).trim();
|
||||
let { length } = content;
|
||||
({ content, length } = await plugins.hooks.fire('filter:messaging.checkContent', { content, length }));
|
||||
if (!content) {
|
||||
throw new Error('[[error:invalid-chat-message]]');
|
||||
|
||||
@@ -19,7 +19,8 @@ function _handleArgs(middleware, middlewares, controller) {
|
||||
middleware.registrationComplete,
|
||||
middleware.authenticateRequest,
|
||||
middleware.pluginHooks,
|
||||
...middlewares];
|
||||
...middlewares,
|
||||
];
|
||||
|
||||
return { middlewares, controller };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user