Patterns: Decode potentially-malformed ampersands in block content #533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #488 — As described there, sometimes images are saved with the ampersands multiply-encoded, resulting in strings like
…img.jpg?w=1200\u0026amp;h=1200\u0026amp;fit=clip
. When used in the editor, the first encoding is decoded, but then…img.jpg?w=1200&h=1200&fit=clip
is not decoded, and causes a 403 error from rawpixel.Additionally, sometimes the slash is stripped, leading to these URLs
…img.jpg?w=1200u0026amp;h=1200u0026amp;fit=clip
, which cause a block validation error.This PR does a very simple string-replacement for these two cases, only on output. Looking for review to make sure this doesn't have any unexpected side effects.
I also removed
get_all_the_content
, it isn't used in this project after all.How to test the changes in this Pull Request:
Copy patterns using both copy buttons — the one on the single pattern page and in the grid view.