2008-09-08, 10:22 PM
Environment (as reported in the AdminCP):
MyBB: 1.4.1
PHP: 5.2.6
DB: MySQLi 4.1.22
Bug:
When you search an IP address using the ModCP (modcp.php?action=ipsearch) and the IP is bigger or equal than 128.0.0.0 (ie: the first byte is >= 128), it turns out that no post nor user is found (assuming that there are such ones registered in the DB, of course).
The problem is with the call to the function fetch_longipv4_range in modcp.php, which it returns a negative integer number for IPs >= 128.0.0.0; and that number is compared with the field longipaddress or longregip in the DB. However, those fields seem to have a positive number, therefore no match is found.
For example, in my forums, the page moderation.php?action=getip&pid=11 returns the IP 213.201.17.42 of that post. In the DB, I see the post in the posts table with these fields: ipadress = "213.201.17.42" and longipaddress = "2147483647". However, when I go to the page modcp.php?action=ipsearch&ipaddress=213.201.17.42&search_posts=1 then MyBB can't find any result.
I hope you can solve this problem shortly. Thank you very much.
MyBB: 1.4.1
PHP: 5.2.6
DB: MySQLi 4.1.22
Bug:
When you search an IP address using the ModCP (modcp.php?action=ipsearch) and the IP is bigger or equal than 128.0.0.0 (ie: the first byte is >= 128), it turns out that no post nor user is found (assuming that there are such ones registered in the DB, of course).
The problem is with the call to the function fetch_longipv4_range in modcp.php, which it returns a negative integer number for IPs >= 128.0.0.0; and that number is compared with the field longipaddress or longregip in the DB. However, those fields seem to have a positive number, therefore no match is found.
For example, in my forums, the page moderation.php?action=getip&pid=11 returns the IP 213.201.17.42 of that post. In the DB, I see the post in the posts table with these fields: ipadress = "213.201.17.42" and longipaddress = "2147483647". However, when I go to the page modcp.php?action=ipsearch&ipaddress=213.201.17.42&search_posts=1 then MyBB can't find any result.
I hope you can solve this problem shortly. Thank you very much.