Rollup merge of #46010 - lnicola:escape-root, r=GuillaumeGomez

rustdoc: Escape doc root URLs

This fixes a small HTML injection issue.
This commit is contained in:
Guillaume Gomez
2017-11-16 10:05:07 +01:00
committed by GitHub
+1 -1
View File
@@ -1683,7 +1683,7 @@ fn src_href(&self) -> Option<String> {
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))