Jump to content

Illegal string offset error


Stefan83

Recommended Posts

Hi


Can anyone tell me what is wrong with the code below?


I'm getting a Warning: Illegal string offset 'redirect' in... error in this line:



if (preg_match("/aeid/", $confirmation['redirect'])){

I've just updated php to 5.4 and I get the error when I submit a gravity form for wordpress via ajax



function salesmod_confirm_change($confirmation, $form, $lead, $ajax){
if (preg_match("/aeid/", $confirmation['redirect'])){
if (!$_GET['cfn']) {
$confirm_id = substr(md5( substr(md5(time()), 0, 16)), 0, 16);
gform_update_meta($lead['id'], 'confirmation_id', $confirm_id);
} else {
$confirm_id = $_GET['cfn'];

}
$confirmation = array('redirect' => $confirmation['redirect'] . "&cfn=" . $confirm_id);
}
return $confirmation;
}

Thanks


Link to comment
https://forums.phpfreaks.com/topic/294507-illegal-string-offset-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.