Skip to content

Commit e365120

Browse files
Prevent invalid html characters in themes name
1 parent d350008 commit e365120

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
@@ -569,7 +569,9 @@ fn write_shared(
569569
let content = try_err!(fs::read(&entry), &entry);
570570
let theme = try_none!(try_none!(entry.file_stem(), &entry).to_str(), &entry);
571571
let extension = try_none!(try_none!(entry.extension(), &entry).to_str(), &entry);
572-
cx.shared.fs.write(cx.path(&format!("{}.{}", theme, extension)), content.as_slice())?;
572+
cx.shared.fs.write(
573+
cx.path(&format!("{}.{}", Escape(theme), extension)),
574+
content.as_slice())?;
573575
themes.insert(theme.to_owned());
574576
}
575577

0 commit comments

Comments
 (0)