Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Ban plugin: implode warnings when I try to add an Ipaddress to add ip ban.
Avatar
rb22
Member
sp_UserOfflineSmall Offline
Apr 30, 2013 - 8:45 pm

Hi,

The following warning messages show when run the ban plugin and try to add an ip address. The Ip address does not get added.
I am trying this on wp s 3.4.1.  simpl-press 5.1.3  ... and also on recent versions of wp and simplepress..

centos/cpanel

php 5.2.17

========

Add IP Ban
Warning: Implode() [function.implode]: Invalid arguments passed in .../wp-content/sp-resources/forum-plugins/ban/admin/sp-ban-admin.php on line 39

Add Ip Ban range.
Warning: implode() [function.implode]: Invalid arguments passed in .../public_html/wp-content/sp-resources/forum-plugins/ban/admin/sp-ban-admin.php on line 47

Add Hostname Ban
Warning: implode() [function.implode]: Invalid arguments passed in .../public_html/wp-content/sp-resources/forum-plugins/ban/admin/sp-ban-admin.php on line 57

Add User Agent Ban
Warning: implode() [function.implode]: Invalid arguments passed in .../public_html/wp-content/sp-resources/forum-plugins/ban/admin/sp-ban-admin.php on line 65
24.36.78.

Avatar
rb22
Member
sp_UserOfflineSmall Offline
Apr 30, 2013 - 8:58 pm

Also seeing this when wp loads ... prints out over the header.

 

Warning: Invalid argument supplied for foreach() in .../wp-content/sp-resources/forum-plugins/ban/library/sp-ban-components.php on line 35

Warning: Invalid argument supplied for foreach() in .../wp-content/sp-resources/forum-plugins/ban/library/sp-ban-components.php on line 49

Warning: Invalid argument supplied for foreach() in .../public_html/wp-content/sp-resources/forum-plugins/ban/library/sp-ban-components.php on line 35

Warning: Invalid argument supplied for foreach() in .../public_html/wp-content/sp-resources/forum-plugins/ban/library/sp-ban-components.php on line 35

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 30, 2013 - 9:47 pm

Yes, a known issue for a handful of servers in current version... we posted a fix for it in these forums, but cant seem to find it...  we cant release a new version of the plugin because other changes that required SP 5.3...

so quicker just to post the changes here again...  find the sp-ban-admin-save.php file and replace the sp_ban_admin_do_save_bans() function with the replacement one...

function sp_ban_admin_do_save_bans() {
    $ips = explode("\n", trim($_POST['ip_addr']));
    sp_update_option('banned_ips', sp_esc_str($ips));

    $ip_ranges = explode("\n", trim($_POST['ip_addr_range']));
    sp_update_option('banned_ip_ranges', sp_esc_str($ip_ranges));

    $hostnames = explode("\n", trim($_POST['hostname']));
    sp_update_option('banned_hostnames', sp_esc_str($hostnames));

    $user_agents = explode("\n", trim($_POST['user_agent']));
    sp_update_option('banned_agents', sp_esc_str($user_agents));

    return __('Bans updated', 'sp-ban');
}

not sure why it only affects a handful of users (you are second) while most use just fine...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625