Gravityforms Options Bug
-
G’day! I noticed in one of my forms when submitting, I was getting a critical error due to this plugin. I dumped the contents of the
$options
variableget_option('oopspamantispam_settings')
. This is what it returns:array:12 [▼
"oopspam_api_key_source" => "OOPSpamDashboard"
"oopspam_api_key" => "REDACTED"
"oopspam_spam_score_threshold" => "3"
"oopspam_spam_movedspam_to_folder" => "spam"
"oopspam_clear_spam_entries" => "monthly"
"oopspam_clear_ham_entries" => "monthly"
"oopspam_is_check_for_length" => "on"
"oopspam_is_gf_activated" => "1"
"oopspam_gf_spam_message" => "Unfortunately, it looks like your message was caught by our spam filter. Please email us at info@REDACTED.com.au directly."
"oopspam_gf_content_field" => "null"
"oopspam_gf_exclude_form" => ""
"oopspam_api_key_usage" => "18602/100000"
]This part here:
"oopspam_gf_content_field" => "null"
is the issue. It looks like it’s a string “null”, so the plugin sees this and in:plugins/oopspam-anti-spam/integration/GravityForms.php:112
There’s this:
if (isset($options['oopspam_gf_content_field']) && $options['oopspam_gf_content_field']) {
So that means
oopspam_gf_content_field
isstring 'null'
, it’s both set AND is truthy.That then means the proceeding code within the
if
statement will run, and there’s aforeach
that tries to run on$jsonData
which isstring 'null'
. That’s when we get a fatal error because it’s trying to iterate over a string instead of an object/array ??
- You must be logged in to reply to this topic.