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

Don't decode before encoding for new installations #3171

Merged
merged 4 commits into from
Apr 14, 2023

Conversation

Derkades
Copy link
Member

NamelessMC used to HTML-encode posts before saving them to the database. It no longer does. When this change was made, there was never a database migration to decode all encoded content. The reasoning for this was that this migration would be too slow.

Currently, before being encoded, content is always decoded first. This improves compatibility with content that was stored in encoded form, preventing it from being encoded twice. However, it also causes various issues for new content that is stored in non-encoded form.

Code snippets and more complex usage of special characters do not work properly.

With this change, the compatibility decoding has been made configurable. It is enabled by default for websites that upgrade from a previous version, and disabled (as it should always should be) for new installations.

Ideally it would only be enabled for websites that have upgraded from pr12, but I don't think there's any way to detect that?

@Derkades Derkades added the bug label Jan 12, 2023
@Derkades Derkades added this to the 2.1.0 milestone Jan 12, 2023
@Derkades Derkades force-pushed the fix/remove-decode-before-encode branch from ade2a36 to 51ccc62 Compare January 12, 2023 16:57
@Derkades Derkades merged commit d6ac7ae into develop Apr 14, 2023
@Derkades Derkades deleted the fix/remove-decode-before-encode branch April 14, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants