IP address format

Open to all! Ask other shopowners for help.
Post Reply
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

IP address format

Post 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?


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: IP address format

Post by ecartz »

That's an IPv6 (IPv4 is the 123.45.67.89 form).
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

Re: IP address format

Post by ReneH4 »

Any idea why IPv6 addresses do not show in who's online? (1079)
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: IP address format

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply