Skip to main content

script_string_literal

Function script_string_literal 

Source
fn script_string_literal(value: &str) -> String
Expand description

Serialise value as a JavaScript string literal that is safe to embed in the inline <script> element of the directory listing. {:?} produces a valid literal but leaves any < (and therefore </script>) untouched, which lets a crafted file name close the script element and inject markup into the page.