Amend last commit, fix regex
This commit is contained in:
parent
6042c510e1
commit
b565324ec3
2
user.js
2
user.js
|
@ -38,7 +38,7 @@ User.prototype.initCallbacks = function() {
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.socket.on('joinChannel', function(data) {
|
this.socket.on('joinChannel', function(data) {
|
||||||
if(!data.name.match(/[a-zA-Z0-9]+/))
|
if(!data.name.match(/^[a-zA-Z0-9]+$/))
|
||||||
return;
|
return;
|
||||||
// Channel already loaded
|
// Channel already loaded
|
||||||
if(data.name in Server.channels) {
|
if(data.name in Server.channels) {
|
||||||
|
|
|
@ -61,7 +61,7 @@ if(params['channel'] == undefined) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(!params['channel'].match(/[a-zA-Z0-9]+/)) {
|
else if(!params['channel'].match(/^[a-zA-Z0-9]+$/)) {
|
||||||
$('<div/>').addClass('alert alert-error')
|
$('<div/>').addClass('alert alert-error')
|
||||||
.insertAfter($('.row')[0])[0]
|
.insertAfter($('.row')[0])[0]
|
||||||
.innerHTML = "<h3>Invalid Channel Name</h3><p>Channel names must conain only numbers and letters</p>";
|
.innerHTML = "<h3>Invalid Channel Name</h3><p>Channel names must conain only numbers and letters</p>";
|
||||||
|
|
Loading…
Reference in a new issue