Skip to content
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

Replace ammonia lib with manual html escaping (fixes #3774) #3938

Merged
merged 7 commits into from Sep 6, 2023

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented Sep 5, 2023

The ammonia library is not what we need, for our use case its better to replace problematic HTML characters directly. This should fix all the problems like removing <script> tags from code blocks. Based on my testing, lemmy-ui currently does some html escaping of its own, so we need to get rid of that.

}

pub fn sanitize_html_federation_opt(data: &Option<String>) -> Option<String> {
data.as_ref().map(|d| sanitize_html_federation(d))
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main change here.

Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dessalines dessalines merged commit 71d6113 into main Sep 6, 2023
1 check passed
@AndrejsK
Copy link

AndrejsK commented Sep 6, 2023

Looks like this PR has accidentally removed a table from the diesel schema added in #3927

@dessalines
Copy link
Member

I've added it back in, in the scaled-sort pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants