Wordpress: Fix URLs with queries#1534
Merged
extesy merged 1 commit intoextesy:masterfrom Feb 5, 2025
Merged
Conversation
Turn this: https://i0.wp.com/lgbtqreads.com/wp-content/uploads/2024/02/JFP_MMN_COV_mksm.jpg?resize=197%2C300&ssl=1 into this: https://i0.wp.com/lgbtqreads.com/wp-content/uploads/2024/02/JFP_MMN_COV_mksm.jpg Also avoid breaking URLs with a resolution baked into the file name if they also have queries at the end: https://i0.wp.com/lgbtqreads.com/wp-content/uploads/2024/12/ItsaLoveSkateRelationship-hc-c-678x1024-1.jpg?resize=199%2C300&ssl=1 "-678x1024" is supposed to be there. Also handle URLs that don't have "wp-content" in them even though they're hosted at i0.wp.com: https://i0.wp.com/i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1665507126l/58762417._SX318_.jpg?resize=187%2C279&ssl=1 Technically some of these should also have the "._crap_" removed, but I had enough. Test page: https://lgbtqreads.com/2025/02/05/happy-national-girls-and-women-in-sports-day-2025/ Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
|
Owner
|
Thank you for the contribution, @dubhater |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Turn this:
https://i0.wp.com/lgbtqreads.com/wp-content/uploads/2024/02/JFP_MMN_COV_mksm.jpg?resize=197%2C300&ssl=1
into this:
https://i0.wp.com/lgbtqreads.com/wp-content/uploads/2024/02/JFP_MMN_COV_mksm.jpg
Also avoid breaking URLs with a resolution baked into the file name if they also have queries at the end:
https://i0.wp.com/lgbtqreads.com/wp-content/uploads/2024/12/ItsaLoveSkateRelationship-hc-c-678x1024-1.jpg?resize=199%2C300&ssl=1
"-678x1024" is supposed to be there.
Also handle URLs that don't have "wp-content" in them even though they're hosted at i0.wp.com:
https://i0.wp.com/i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1665507126l/58762417._SX318_.jpg?resize=187%2C279&ssl=1
Technically some of these should also have the
._crap_removed, but I had enough.Test page:
https://lgbtqreads.com/2025/02/05/happy-national-girls-and-women-in-sports-day-2025/