Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Patch #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions player/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,6 @@ eidogo.Player.prototype = {
me.load(this.root, target);
completeFn && completeFn();
});
} else if (data.charAt(0) == '{') {
// JSON
data = eval("(" + data + ")");
this.load(data, target);
completeFn && completeFn();
} else {
this.croak(t['invalid data']);
}
Expand Down Expand Up @@ -972,7 +967,7 @@ eidogo.Player.prototype = {
contBranch.C = moveNum > 1 ? "<a id='cont-search' href='#'>" +
t['show games'] + "</a>" : "";
var cont,
conts = eval('(' + req.responseText + ')');
conts = JSON.parse(req.responseText);
if (conts.length) {
conts.sort(function(a, b) { return parseInt(b.count, 10) - parseInt(a.count, 10); });
var highCount = parseInt(conts[0].count, 10);
Expand Down Expand Up @@ -1474,7 +1469,7 @@ eidogo.Player.prototype = {
this.dom.searchCount.innerHTML = "No";
return;
}
var ret = eval("(" + req.responseText + ")");
var ret = JSON.parse(req.responseText);
var results = ret.results,
result,
html = "",
Expand Down
12 changes: 10 additions & 2 deletions player/js/sgf.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ eidogo.SgfParser.prototype = {
this.index++;
}
}
values[i] += this.curChar();
if (this.curChar() === '<') {
values[i] += '&lt';
} else if (this.curChar() === '>') {
values[i] += '&gt';
} else if (this.curChar() === '&') {
values[i] += '&amp';
} else {
values[i] += this.curChar();
}
this.index++;
}
i++;
Expand Down Expand Up @@ -105,4 +113,4 @@ eidogo.SgfParser.prototype = {
curChar: function() {
return this.sgf.charAt(this.index);
}
};
};