浏览代码

Added an extra check to see if a chat message contains only spaces or not.

KrisVos130 9 年之前
父节点
当前提交
e03e4aafd7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/server/server.js

+ 1 - 1
app/server/server.js

@@ -478,7 +478,7 @@ Meteor.methods({
             var rawrank = user.profile.rank;
             var username = user.profile.username;
             var rank = user.profile.rank;
-            if (message.length === 0) {
+            if (!message.replace(/\s/g, "").length > 0) {
                 throw new Meteor.Error(406, "Message length cannot be 0.");
             }
             if (message.length > 300) {