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

Escape user-edited fields in OpenGraph meta tags #415

Merged
merged 1 commit into from
Mar 13, 2022

Conversation

HebaruSan
Copy link
Contributor

@HebaruSan HebaruSan commented Oct 28, 2021

Problems

Causes

Changes

  • Now the Jinja2 escape filter is applied to each instance of user-edited text in the og: meta tags, which will prevent them from terminating the attributes. bleach was mangling the text in a way that prevented escape from working, so I replaced bleach instead of combining them.
  • Now if latest is None, we skip the whole first line of the mod description and just return Mod.short_description by itself
  • Now if the user has a background set on his or her profile, it will be returned as the og:image rather than /static/og.png

Fixes #407.

@HebaruSan HebaruSan added Type: Bug Area: Backend Related to the Python code that runs inside gunicorn Priority: High Status: Ready labels Oct 28, 2021
@HebaruSan HebaruSan requested a review from DasSkelett October 28, 2021 03:26
@HebaruSan HebaruSan linked an issue Oct 31, 2021 that may be closed by this pull request
@HebaruSan HebaruSan added the Scope: Medium Moderately complex changes requiring non-trivial time and effort to develop and review label Nov 13, 2021
@DasSkelett DasSkelett merged commit 9a3314b into KSP-SpaceDock:alpha Mar 13, 2022
@HebaruSan HebaruSan deleted the fix/og-escaping branch March 13, 2022 17:17
@HebaruSan HebaruSan mentioned this pull request Apr 25, 2022
@HebaruSan HebaruSan mentioned this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Backend Related to the Python code that runs inside gunicorn Priority: High Scope: Medium Moderately complex changes requiring non-trivial time and effort to develop and review Status: Ready Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Modpack descriptions not escaped in og:description meta
2 participants