Skip to content

Commit

Permalink
fixup! Cope with test names containing angle brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
peitschie committed Sep 18, 2014
1 parent ccfc93a commit 416e0e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webodf/lib/core/UnitTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ core.UnitTester = function UnitTester() {
* @return {!string}
**/
function link(text, code) {
// NASTY HACK, DO NOT RE-USE. String concatenation with uncontrolled user input is a bad idea for building DOM
// fragments everyone. If you feel tempted to extract the HTML escape thing from here, please force yourself to
// visit http://shebang.brandonmintern.com/foolproof-html-escaping-in-javascript/ first, and learn a better
// approach to take.

return "<span style='color:blue;cursor:pointer' onclick='" + code + "'>"
+ text.replace(/</g, "&lt;") + "</span>";
}
Expand Down

0 comments on commit 416e0e5

Please sign in to comment.