diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-06-30 19:09:58 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-18 16:43:48 +0100 |
| commit | e3651202431f1b07e51a008cd8a8a242a12ab4f1 (patch) | |
| tree | e2d9144055f3e2897bc3fc449c3236a1914ed7eb /src | |
| parent | d350008c884ef1bd3bcae88fd7af9cea125764a0 (diff) | |
| download | rust-e3651202431f1b07e51a008cd8a8a242a12ab4f1.tar.gz rust-e3651202431f1b07e51a008cd8a8a242a12ab4f1.zip | |
Prevent invalid html characters in themes name
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/render.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 9a87bcc10db..7eb49ead527 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -569,7 +569,9 @@ fn write_shared( let content = try_err!(fs::read(&entry), &entry); let theme = try_none!(try_none!(entry.file_stem(), &entry).to_str(), &entry); let extension = try_none!(try_none!(entry.extension(), &entry).to_str(), &entry); - cx.shared.fs.write(cx.path(&format!("{}.{}", theme, extension)), content.as_slice())?; + cx.shared.fs.write( + cx.path(&format!("{}.{}", Escape(theme), extension)), + content.as_slice())?; themes.insert(theme.to_owned()); } |
