Skip to content

Commit 2aa57e9

Browse files
Prevent invalid html characters in themes name
1 parent 8df4ce2 commit 2aa57e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/html/render.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,9 @@ fn write_shared(
568568
let content = try_err!(fs::read(&entry), &entry);
569569
let theme = try_none!(try_none!(entry.file_stem(), &entry).to_str(), &entry);
570570
let extension = try_none!(try_none!(entry.extension(), &entry).to_str(), &entry);
571-
cx.shared.fs.write(cx.path(&format!("{}.{}", theme, extension)), content.as_slice())?;
571+
cx.shared.fs.write(
572+
cx.path(&format!("{}.{}", Escape(theme), extension)),
573+
content.as_slice())?;
572574
themes.insert(theme.to_owned());
573575
}
574576

0 commit comments

Comments
 (0)