mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
anons cant edit after posting #365
This commit is contained in:
@@ -541,8 +541,15 @@ module.exports.init = function(io) {
|
||||
});
|
||||
|
||||
socket.on('api:posts.edit', function(data) {
|
||||
|
||||
if (!data.title || data.title.length < topics.minimumTitleLength) {
|
||||
if(!uid) {
|
||||
socket.emit('event:alert', {
|
||||
title: 'Can't edit',
|
||||
message: 'Guests can't edit posts!',
|
||||
type: 'warning',
|
||||
timeout: 2000
|
||||
});
|
||||
return;
|
||||
} else if (!data.title || data.title.length < topics.minimumTitleLength) {
|
||||
topics.emitTitleTooShortAlert(socket);
|
||||
return;
|
||||
} else if (!data.content || data.content.length < require('../public/config.json').minimumPostLength) {
|
||||
|
||||
Reference in New Issue
Block a user