Forráskód Böngészése

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

KrisVos130 9 éve
szülő
commit
e03e4aafd7
1 módosított fájl, 1 hozzáadás és 1 törlés
  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) {