Repository navigation
Ensure our IPv4-in-IPv6 address check works for PHP <8.3 - #952
Conversation
…ds an IPv4 address. This isn't needed for PHP 8.3+ but we need to support lower versions
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #952 +/- ##
==========================================
Coverage 74.39% 74.39%
- Complexity 3107 3110 +3
==========================================
Files 132 132
Lines 12160 12166 +6
==========================================
+ Hits 9046 9051 +5
- Misses 3114 3115 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

What?
Add in a new
embeds_ipv4_addressmethod to check if an IPv6 address embeds an IPv4 address.Why?
We recently added more robust URL checking before allowing an image to be downloaded and our IPv4-in-IPv6 address check works as expected on PHP 8.3+ but PHP versions lower than that weren't working without additional checks.
How?
embeds_ipv4_addressmethod that we run when checking an IP to ensure we support PHP 8.2 and lower the same as PHP 8.3+Use of AI Tools
AI assistance: Yes
Tool(s): Cursor
Model(s): Opus 5
Used for: Diagnosing the failing unit tests, figuring out the reason why and suggesting a fix. Review and testing by me
Testing Instructions
Not really much to test here as this is meant to prevent private IP addresses from being used when someone directly calls the Alt Text Ability with a custom image URL, so hard to reproduce. If desired, can test that the Alt Text Generation experiment still works as expected
Changelog Entry
n/a - This is just a fix that a different PR missed