Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm not sure this module is actively maintained but I share the problem and solution for people who meet the same issue in the future.
Problem/Motivation
When Drupal cron runs and the hook_cron() of this module is invoked, an error occurs.
explode() expects parameter 2 to be string, array given
This occurs in the following line.
watchdog('smart_ip_ban', 'Following IPs have been unblocked !ips', array('!ips' => explode(', ', $ips)));
Here, $ips
is expected to be a string but actually an array.
Proposed resolution
I believe explode()
in the above line is wrong and should be implode()
.
Remaining tasks
- Create a patch
- Review the patch
User interface changes
(None)
API changes
(None)
Data model changes
(None)
Comment | File | Size | Author |
---|---|---|---|
#2 | smart_ip_ban-fix_explode_error_in_cron-2974264-2.patch | 511 bytes | hgoto |
Comments
Comment #2
hgoto CreditAttribution: hgoto as a volunteer commented