about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-06-30 19:09:58 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-11-18 16:43:48 +0100
commite3651202431f1b07e51a008cd8a8a242a12ab4f1 (patch)
treee2d9144055f3e2897bc3fc449c3236a1914ed7eb /src
parentd350008c884ef1bd3bcae88fd7af9cea125764a0 (diff)
downloadrust-e3651202431f1b07e51a008cd8a8a242a12ab4f1.tar.gz
rust-e3651202431f1b07e51a008cd8a8a242a12ab4f1.zip
Prevent invalid html characters in themes name
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render.rs4
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());
     }