-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: escape shown input to prevent injection #13895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Since we have jquery, can we rely on jquery instead? |
It seems hacky to use in this context because those are getters methods (have to be applied to a DOM element?). This page linked on the stackoverflow post suggests:
...with a fake DOM element as a shim. The last comment on the page even states:
|
I think that comment may be a red herring referring to some other method of adding text to a page. I think something like this should do the trick:
|
As in, I think that the comment is generally referring to executing My concern from defining our own |
Yeah, +1 on that. I'm sure jQuery's escaping is awesome. |
The Anyways, updated. |
See #13884 for the details. Closes #13884. r? @alexcrichton
I opened rust-lang/rust-clippy#13896 before. However, I found that there're more cases where Clippy suggests to use modules that belong to the `std` crate even in a `no_std` environment. Therefore, this PR include the changes I've made in rust-lang#13896 and new changes to fix cases I found this time to prevent wrong suggestions in `no_std` environments as well. changelog: [`redundant_closure`]: correct suggestion in `no_std` changelog: [`repeat_vec_with_capacity`]: correct suggestion in `no_std` changelog: [`single_range_in_vec_init`]: don't emit suggestion to use `Vec` in `no_std` changelog: [`drain_collect`]: correct suggestion in `no_std` changelog: [`map_with_unused_argument_over_ranges`]: correct suggestion in `no_std` also close rust-lang#13895
See #13884 for the details. Closes #13884.
r? @alexcrichton