fix sanitizer exception on null string

This commit is contained in:
ali asaria 2011-03-12 13:40:44 -05:00
parent 3ad513358e
commit 30860ab066
3 changed files with 20 additions and 14 deletions

View file

@ -106,14 +106,21 @@ socket.on('connection', function(client){
//santizes text
function scrub( text ) {
//clip the string if it is too long
if (text.length > 65535)
if (typeof text != "undefined" && text !== null)
{
text = text.substr(0,65535);
}
return sanitizer.sanitize(text);
//clip the string if it is too long
if (text.length > 65535)
{
text = text.substr(0,65535);
}
return sanitizer.sanitize(text);
}
else
{
return null;
}
}