Illegal string offset exception when cf7msm_check cookie not present.
-
Hi, I’d noticed that our logs where getting full of exceptions the other day since we started using your plugin.
I pulled the site out of live and into a development to see what’s going on and noticed that the exception “Illegal string offset” being thrown from line 144 of the file “contact-form-7-multi-step-module.php”. After some investigation the error only appears to happen to new visitors when the cookie “cf7msm_check” is not present. Subsequent requests work fine once the cookie was set.
Updated your code at line 144 from:
$cf7msm_posted_data['cf7msm_prev_urls'] = cf7msm_get('cf7msm_prev_urls');
To the following:
if(is_array($cf7msm_posted_data)){ $cf7msm_posted_data['cf7msm_prev_urls'] = cf7msm_get('cf7msm_prev_urls'); } else { $cf7msm_posted_data = json_decode( $cf7msm_posted_data, true ); }
Which appears to have resolved the issue. Is there any chance of updating your release branch for your plugin with this snippet?
Thanks in advance,
S
- The topic ‘Illegal string offset exception when cf7msm_check cookie not present.’ is closed to new replies.