Explorar o código

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

KrisVos130 %!s(int64=9) %!d(string=hai) anos
pai
achega
e03e4aafd7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {