Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
escape the browser version in js (bug 574835)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Jul 16, 2010
1 parent 5eb2fdd commit b754624
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion media/js/zamboni/init.js
Expand Up @@ -98,6 +98,17 @@ jQuery.fn.hasattr = function(name) {
}


var escape_ = function(s){
return s.replace('&', '&amp;').replace('>', '&gt;').replace('<', '&lt;')
.replace("'", '&#39;').replace('"', '&#34;');
};


jQuery.fn.safeText = function() {
return escape_(this.text());
};


/** Underscore.js extensions **/
_.templateSettings = {
start: '{{',
Expand Down Expand Up @@ -140,7 +151,7 @@ z.os = {windows: false, mac: false, linux: false, other: false};
match = pattern.exec(navigator.userAgent);
if (match && match.length == 3) {
z.browser[browser] = true;
z.browserVersion = match[2];
z.browserVersion = escape_(match[2]);
}
}
// Mobile comes after Firefox to overwrite the browser version.
Expand Down

0 comments on commit b754624

Please sign in to comment.