fix sanitizer exception on null string
This commit is contained in:
parent
3ad513358e
commit
30860ab066
3 changed files with 20 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
var cards = {};
|
||||
var totalcolumns = 0;
|
||||
var columns = [];
|
||||
var currentStyle = "bigcards";
|
||||
var currentTheme = "bigcards";
|
||||
|
||||
|
||||
var socket = new io.Socket( );
|
||||
|
@ -448,6 +448,7 @@ function initColumns( columnArray )
|
|||
|
||||
function changeThemeTo( theme )
|
||||
{
|
||||
currentTheme = theme;
|
||||
$("link[title=cardsize]").attr("href", "/css/" + theme + ".css");
|
||||
}
|
||||
|
||||
|
@ -556,23 +557,21 @@ $(function() {
|
|||
|
||||
// Style changer
|
||||
$("#smallify").click(function(){
|
||||
if (currentStyle == "bigcards")
|
||||
if (currentTheme == "bigcards")
|
||||
{
|
||||
currentStyle = "smallcards";
|
||||
changeThemeTo('smallcards');
|
||||
}
|
||||
else if (currentStyle == "smallcards")
|
||||
else if (currentTheme == "smallcards")
|
||||
{
|
||||
currentStyle = "bigcards";
|
||||
changeThemeTo('bigcards');
|
||||
}
|
||||
/*else if (currentStyle == "nocards")
|
||||
/*else if (currentTheme == "nocards")
|
||||
{
|
||||
currentStyle = "bigcards";
|
||||
currentTheme = "bigcards";
|
||||
$("link[title=cardsize]").attr("href", "css/bigcards.css");
|
||||
}*/
|
||||
|
||||
sendAction('changeTheme', currentStyle);
|
||||
sendAction('changeTheme', currentTheme);
|
||||
|
||||
|
||||
return false;
|
||||
|
|
0
forever.sh
Normal file → Executable file
0
forever.sh
Normal file → Executable file
|
@ -106,6 +106,8 @@ socket.on('connection', function(client){
|
|||
|
||||
//santizes text
|
||||
function scrub( text ) {
|
||||
if (typeof text != "undefined" && text !== null)
|
||||
{
|
||||
|
||||
//clip the string if it is too long
|
||||
if (text.length > 65535)
|
||||
|
@ -114,6 +116,11 @@ function scrub( text ) {
|
|||
}
|
||||
|
||||
return sanitizer.sanitize(text);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue