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
commit d57fed893e

View file

@ -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))