Fix bad channel names
This commit is contained in:
parent
090eaa37c2
commit
6042c510e1
2 changed files with 9 additions and 0 deletions
|
|
@ -61,6 +61,12 @@ if(params['channel'] == undefined) {
|
|||
}
|
||||
});
|
||||
}
|
||||
else if(!params['channel'].match(/[a-zA-Z0-9]+/)) {
|
||||
$('<div/>').addClass('alert alert-error')
|
||||
.insertAfter($('.row')[0])[0]
|
||||
.innerHTML = "<h3>Invalid Channel Name</h3><p>Channel names must conain only numbers and letters</p>";
|
||||
|
||||
}
|
||||
else {
|
||||
socket.emit('joinChannel', {
|
||||
name: params['channel']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue