Page 1 of 1
IP address format
Posted: Thu Feb 17, 2022 4:37 pm
by ReneH4
Can anyone tell me what the format type is of this IP address?
It shows blank in who's online
Code: Select all
2001:1c00:2e0a:de00:4d8f:a3f6:ab14:9207
Reason why I ask is because I am investigating a brute force attack to my domain. It has caused it to go down a few times now.
IP's like these show up a lot, but can they be blocked using .htaccess?
Re: IP address format
Posted: Thu Feb 17, 2022 5:15 pm
by ecartz
That's an IPv6 (IPv4 is the 123.45.67.89 form).
Re: IP address format
Posted: Fri Feb 18, 2022 10:44 am
by ReneH4
Any idea why IPv6 addresses do not show in who's online? (1079)
Re: IP address format
Posted: Fri Feb 18, 2022 2:50 pm
by ecartz
Who's online only uses IPv4. This was a deliberate choice at some time.
https://github.com/CE-PhoenixCart/Phoen ... st.php#L40
You can change it to
Code: Select all
if (filter_var($ip, FILTER_VALIDATE_IP)) {
That would accept either IPv6 or IPv4. The limitation to IPv4 predates the community edition, so I don't know why it was done originally (I did preserve it when updating because it hadn't reported any problems). Possibly simply because IPv6 used to be rarer and is bigger than IPv4, so saving it in the database was problematic. But we raised that restriction such that it should no longer be an issue.