about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-11-16 10:05:07 +0100
committerGitHub <noreply@github.com>2017-11-16 10:05:07 +0100
commitd57fed893e63290c7ef58096cabc3aeea514014f (patch)
tree5464cc928aed5b41d3404d620ac5e243bf45e4d1
parentb09af7064edfa7aa19cdc474a7beace88f98e2a8 (diff)
parentcca6cf3febd0eb31f95325bc7a8815509a9d1c26 (diff)
downloadrust-d57fed893e63290c7ef58096cabc3aeea514014f.tar.gz
rust-d57fed893e63290c7ef58096cabc3aeea514014f.zip
Rollup merge of #46010 - lnicola:escape-root, r=GuillaumeGomez
rustdoc: Escape doc root URLs

This fixes a small HTML injection issue.
-rw-r--r--src/librustdoc/html/render.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 69eaf24289b..e848a8d3853 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1683,7 +1683,7 @@ impl<'a> Item<'a> {
             format!("{}-{}", self.item.source.loline, self.item.source.hiline)
         };
         Some(format!("{root}src/{krate}/{path}#{lines}",
-                     root = root,
+                     root = Escape(&root),
                      krate = krate,
                      path = path,
                      lines = lines))