dotkernel / admin

DotKernel Admin Application, built on top of Mezzio microframework and using Laminas components.ezzio for branch 2 and above.
https://admin5.dotkernel.net
MIT License
26 stars 5 forks source link

handle error if geoip does not return a valid IP #231

Closed arhimede closed 5 months ago

arhimede commented 5 months ago

https://github.com/dotkernel/dot-geoip

handle in controller if for instance is a local IP

arhimede commented 5 months ago

https://github.com/dotkernel/admin/blob/4.0/src/App/src/Service/IpService.php#L49C17-L49C31 extend the function validIp

arhimede commented 5 months ago

use the constant FILTER_VALIDATE_IP https://www.php.net/manual/en/filter.filters.validate.php

arhimede commented 5 months ago

valiadte the IP at return

arhimede commented 5 months ago

use FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE instead of hardcoded 172.0.0.1