Skip to content

Node.js based forum software built for the modern web

content check in posts

Baris Usakli4f9a2d0b93ff
diff --git a/src/posts.js b/src/posts.js
index a033fc3bfb..9fb37cc0fe 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -180,9 +180,17 @@ marked.setOptions({
timeout: 2000
});
return;
+ } else if (!content || content.length <= 9) {
+ socket.emit('event:alert', {
+ type: 'error',
+ timeout: 5000,
+ title: 'Content too short',
+ message: "Please enter a longer post.",
+ alert_id: 'post_error'
+ });
+ return;
}
-
user.getUserField(uid, 'lastposttime', function(lastposttime) {
if(Date.now() - lastposttime < config.post_delay) {