Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing my own XSS issue

  • Loading branch information...
commit 0cbf84ccd4c8f5545be22b7096188ef46450b7aa 1 parent a960294
@mattlunn authored
Showing with 10 additions and 7 deletions.
  1. +10 −7 component/latest.js
View
17 component/latest.js
@@ -66,13 +66,16 @@
}
edit.fadeOut('slow', function () {
- $('.suggested-edit:first').before([
- "<div class='answer-summary question-summary'><div class='summary'>",
- "<a href=\"" + href + "\" class=\"question-hyperlink\">" + title + "</a> ",
- "(<a href='" + edit.find('a.link').prop('href') + "'>" + description + "</a>)</div></div>"
- ].join('')).fadeIn("fast");
-
- $(this).remove();
+ var summary = $([
+ "<div class='answer-summary question-summary'><div class='summary'>",
+ "<a href=\"" + href + "\" class=\"question-hyperlink\"></a> ",
+ "(<a href='" + edit.find('a.link').prop('href') + "'>" + description + "</a>)</div></div>"
+ ].join(''));
+
+ summary.find('a.question-hyperlink').text(title);
+ summary.insertBefore('.suggested-edit:first');
+
+ edit.remove();
});
} else {
edit.fadeTo(500, 0.3);
Please sign in to comment.
Something went wrong with that request. Please try again.