htdocs: Fix escaping of html characters in /devinfo.
This commit is contained in:
parent
2a78db4c06
commit
851b80341c
|
@ -2,6 +2,11 @@
|
|||
|
||||
/* jshint quotmark:true, jquery:true */
|
||||
|
||||
// htmlEntities taken from http://css-tricks.com/snippets/javascript/htmlentities-for-javascript/
|
||||
function htmlEntities(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
jQuery.fn.listCommits = function(username, repository, branch) {
|
||||
this.html('<span>Querying GitHub for recent commits…</span>');
|
||||
|
||||
|
@ -13,7 +18,7 @@ jQuery.fn.listCommits = function(username, repository, branch) {
|
|||
|
||||
$(commits).each(function(i) {
|
||||
var githubUrl = 'https://github.com/' + username + '/' + repository + '/commit/' + this.sha,
|
||||
shortMessage = cutLines(this.commit.message);
|
||||
shortMessage = htmlEntities(cutLines(this.commit.message));
|
||||
|
||||
if (this.author !== null) {
|
||||
list.append('<li><a href="' + githubUrl + '">' + shortMessage + '</a><em> by <strong><a class="author" href="' + 'https://github.com/' + this.author.login + '">' + this.author.login + '</a></strong></em></li>');
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue