about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Morgan <me@chrismorgan.info>2015-04-28 13:31:45 +1000
committerChris Morgan <me@chrismorgan.info>2015-04-28 13:31:45 +1000
commit928bd4fe1006d4319ab58bdadf42c07b37eb7249 (patch)
treed589d1a73993e06c9855b16d7feebdeb8a44a50c
parent5fb0259edfbc4034cfbcf827ab91d6118b7ae848 (diff)
Fix #24872, XSS in docs not found page.
-rw-r--r--src/doc/not_found.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/doc/not_found.md b/src/doc/not_found.md
index eae2bf1925a..e740bf3c223 100644
--- a/src/doc/not_found.md
+++ b/src/doc/not_found.md
@@ -57,8 +57,12 @@ function populate_rust_search() {
 
     // #18540, use a single token
 
+    var a = document.createElement("a");
+    a.href = "http://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
+    a.textContent = lt;
     var search = document.getElementById('core-search');
-    search.innerHTML = "<a href=\"http://doc.rust-lang.org/core/?search=" + lt + "\">" + lt + "</a>";
+    search.innerHTML = "";
+    search.appendChild(a);
 }
 populate_site_search();
 populate_rust_search();