Hi everyone,
I’m hoping someone can point me in the right direction.
We’re seeing the following fatal error when a Gravity Form is submitted:
Fatal error: Uncaught TypeError: preg_split(): Argument #2 ($subject) must be of type string, array given
The stack trace shows:
Gravity_Remote_Blacklist->check_if_entery_is_spam()
GFCommon::is_spam_entry()
GFFormDisplay::handle_submission()
The fatal error occurs on this line in a plugin called gravity-remote-blacklist-api:
preg_split(...)
where the second argument is an array instead of a string.
My questions are:
- Has Gravity Forms changed the values passed to spam filter hooks in recent versions?
- Are add-ons expected to handle array values for field types such as Name, Address, Checkboxes, Multi Select, List fields, etc.?
- Is this simply a PHP 8 compatibility issue where the plugin should be checking
is_array()before callingpreg_split()? - Has anyone else encountered this with custom spam-check plugins?
From the stack trace, it appears the error originates in the third-party plugin rather than Gravity Forms itself, but I’m trying to determine whether a change in Gravity Forms exposed a compatibility issue that older plugins weren’t expecting.
Any advice or pointers to the relevant documentation would be greatly appreciated.
Thanks!