From 57f9bfbe0bd9f89a602c5f16bff100af84ae7f83 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Tue, 3 Jan 2012 19:50:17 -0700 Subject: [PATCH] validate sent chat to avoid spurious join messages --- lib/Chatty/Controller/Chat.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Chatty/Controller/Chat.pm b/lib/Chatty/Controller/Chat.pm index 911c127..01cb234 100644 --- a/lib/Chatty/Controller/Chat.pm +++ b/lib/Chatty/Controller/Chat.pm @@ -95,7 +95,8 @@ sub view :Chained(room) :PathPart('') :Args(1) { my $name = $c->user->obj->username; my $msg = $c->req->param('msg'); - if ($msg) { + if (defined $msg) { + return if $msg eq ''; $c->model('Meteor')->addMessage($room, "$name: $msg"); $c->stash->{json} = \1; $c->forward('View::JSON'); -- 2.45.2