1

A few IPs aren't being detected as "reserved" by PHP.

For example, these:

229.39.139.126 - https://ip-api.com/#229.39.139.126
239.148.182.94 - https://ip-api.com/#239.148.182.94

Are reported as "reserved range" in the website above.
Other IP services also say these IPs are invalid.

    return filter_var(
        $ip, 
        FILTER_VALIDATE_IP, 
        FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE
    ) !== false;

Am I doing anything wrong, or could this be a bug in PHP?

Nuno
  • 3,082
  • 5
  • 38
  • 58
  • 1
    @Mihai https://en.wikipedia.org/wiki/Reserved_IP_addresses – deceze Nov 24 '19 at 15:30
  • Well, you can see the current implementation of that filter here: https://github.com/php/php-src/blob/5d6e923d46a89fe9cd8fb6c3a6da675aa67197b4/ext/filter/logical_filters.c#L842 – deceze Nov 24 '19 at 15:37
  • Seems the other person deleted their comments, but from I can see in that wikipedia page, the two example IPs above should be seen as reserved... I guess I should implement my own solution here... – Nuno Nov 24 '19 at 18:05

0 Answers0