handle the case where a request has no IP address (eg, drush commands)
I think this is an easy one. I noticed with my last CiviCRM upgrade that the drush cache-rebuild
command that's run as part of my deploy process had an error message, saying, "In DAO.php line 1545: is not of type String". I tracked it back to the firewall module at this spot in the code:
https://lab.civicrm.org/extensions/firewall/-/blob/master/Civi/Firewall/Firewall.php#L37
CRM_Utils_System::ipAddress
can return null for requests that originate on the local server, like with my cache rebuild command. So we have to handle this case as an exception, I guess.