mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-08 16:42:48 +01:00
closes #117
This commit is contained in:
@@ -287,6 +287,9 @@ define(['taskbar'], function(taskbar) {
|
||||
titleEl = composer.postContainer.querySelector('input'),
|
||||
bodyEl = composer.postContainer.querySelector('textarea');
|
||||
|
||||
titleEl.value = titleEl.value.trim();
|
||||
bodyEl.value = bodyEl.value.trim();
|
||||
|
||||
if (titleEl.value.length < 3) {
|
||||
return app.alert({
|
||||
type: 'error',
|
||||
|
||||
@@ -184,6 +184,10 @@ var RDB = require('./redis.js'),
|
||||
}
|
||||
|
||||
Posts.reply = function(socket, tid, uid, content, images) {
|
||||
if(content) {
|
||||
content = content.trim();
|
||||
}
|
||||
|
||||
if (uid < 1) {
|
||||
socket.emit('event:alert', {
|
||||
title: 'Reply Unsuccessful',
|
||||
|
||||
@@ -338,6 +338,11 @@ marked.setOptions({
|
||||
if (!category_id)
|
||||
throw new Error('Attempted to post without a category_id');
|
||||
|
||||
if(content)
|
||||
content = content.trim();
|
||||
if(title)
|
||||
title = title.trim();
|
||||
|
||||
if (uid === 0) {
|
||||
socket.emit('event:alert', {
|
||||
title: 'Thank you for posting',
|
||||
|
||||
Reference in New Issue
Block a user