2
0
Эх сурвалжийг харах

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

KrisVos130 9 жил өмнө
parent
commit
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) {