diff options
| author | Kamran Ahmed <kamranahmed.se@gmail.com> | 2016-04-12 07:27:26 +0400 |
|---|---|---|
| committer | Kamran Ahmed <kamranahmed.se@gmail.com> | 2016-04-12 07:27:26 +0400 |
| commit | 5055bbfd3cff5ff88246caa5ce75d60d35d70c0a (patch) | |
| tree | 7eaf31b873bf80b93537629b172cb7438b6d871a | |
| parent | Update readme (diff) | |
| parent | Make the Repo Name and Repo Description XSS safe (diff) | |
| download | githunt-5055bbfd3cff5ff88246caa5ce75d60d35d70c0a.tar.gz | |
Merge pull request #2 from jussch/patch-1
Make the Repo Name and Repo Description XSS safe
| -rw-r--r-- | assets/js/main.js | 7 |
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>' + |
