v1.18.x
Baris Soner Usakli 12 years ago
parent fe996f75b6
commit 8947553ecd

@ -287,6 +287,9 @@ define(['taskbar'], function(taskbar) {
titleEl = composer.postContainer.querySelector('input'), titleEl = composer.postContainer.querySelector('input'),
bodyEl = composer.postContainer.querySelector('textarea'); bodyEl = composer.postContainer.querySelector('textarea');
titleEl.value = titleEl.value.trim();
bodyEl.value = bodyEl.value.trim();
if (titleEl.value.length < 3) { if (titleEl.value.length < 3) {
return app.alert({ return app.alert({
type: 'error', type: 'error',

@ -184,6 +184,10 @@ var RDB = require('./redis.js'),
} }
Posts.reply = function(socket, tid, uid, content, images) { Posts.reply = function(socket, tid, uid, content, images) {
if(content) {
content = content.trim();
}
if (uid < 1) { if (uid < 1) {
socket.emit('event:alert', { socket.emit('event:alert', {
title: 'Reply Unsuccessful', title: 'Reply Unsuccessful',

@ -338,6 +338,11 @@ marked.setOptions({
if (!category_id) if (!category_id)
throw new Error('Attempted to post without a 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) { if (uid === 0) {
socket.emit('event:alert', { socket.emit('event:alert', {
title: 'Thank you for posting', title: 'Thank you for posting',

Loading…
Cancel
Save