New Zenner
- Join Date:
- Apr 2011
- Location:
- Espoo, Finland
- Posts:
- 73
- Plugin Contributions:
- 0
IP Blocker for v1.5.x
Hello,
The following PHP Warnings appeared in the logs, when I tried to add the IP-address to "Blocked IP Addresses" list for the first time (using a link on "Who's Online" page)
--> PHP Warning: in_array() expects parameter 2 to be array, boolean given in admin/includes/functions/extra_functions/ip_blocker_functions.php on line 167.
--> PHP Warning: in_array() expects parameter 2 to be array, boolean given in admin/includes/functions/extra_functions/ip_blocker_functions.php on line 169.
I tried to understand what happened adding and removing (some and all) another IP-addresses.
I tried even to remove all lines from ip_blocker table manually and then add IP-address again.
But unfortunately (??? :-) ) the issue has not appeared again.
Probably I should try to fully remove this addon and then install it again (in order to get the same issue again), but this is not possible at the moment, sorry.
$blocked_ip_array = unserialize($blocklist->fields['ib_blocklist']);
$is_new_address = false;
if (!in_array($newaddress, $blocked_ip_array)) {
$newaddress_all = substr($newaddress, 0, strrpos($newaddress, '.')) . '*';
if (!in_array($newaddress_all, $blocked_ip_array)) {
$blocked_ip_array[] = $newaddress;
$is_new_address = true;
}
}
In my homble opinion (I'm definitely not a pro), something is wrong with usage of unserialize function, which can return a very diffetent typs of value