summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Schultz <jaschultz25@gmail.com>2016-04-11 10:57:46 -0600
committerJustin Schultz <jaschultz25@gmail.com>2016-04-11 10:57:46 -0600
commit470fa55e5d52e4304504d6e9c7d70a979e090eee (patch)
tree7eaf31b873bf80b93537629b172cb7438b6d871a
parentUpdate readme (diff)
downloadgithunt-470fa55e5d52e4304504d6e9c7d70a979e090eee.tar.gz
Make the Repo Name and Repo Description XSS safe
https://i.gyazo.com/f6b91ea18787cf6f4fbce8057f5f5a28.png and https://i.gyazo.com/8655ad7115dfe078854fa109bd4dba90.png
-rw-r--r--assets/js/main.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/assets/js/main.js b/assets/js/main.js
index 2948c37..f84b64e 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -40,10 +40,13 @@ function HubTab() {
var html = '';
$(repositories).each(function (index, repository) {
+ // Make the name and description XSS safe
+ var repFullName = $('<div>').text(repository.full_name).html();
+ var repFullDesc = $('<div>').text(repository.description).html();
html += '<div class="content-item">' +
- '<div class="header"><a href="' + repository.html_url + '">' + repository.full_name + '</a></div>' +
- '<p class="tagline">' + repository.description + '</p>' +
+ '<div class="header"><a href="' + repository.html_url + '">' + repFullName + '</a></div>' +
+ '<p class="tagline">' + repFullDesc + '</p>' +
'<div class="footer">' +
'<span class="footer-stat">' +
'<i class="fa fa-code-fork"></i>' +