PHP error

str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated

/media/shnoulle/data/webdev/master/application/helpers/replacements_helper.php(462)

450 // (e.g. for email and template functions)
451 function ReplaceFields($text, $fieldsarray, $bReplaceInsertans = true, $staticReplace = true)
452 {
453 
454     if ($bReplaceInsertans) {
455         $replacements = array();
456         foreach ($fieldsarray as $key => $value) {
457             $replacements[substr((string) $key, 1, -1)] = $value;
458         }
459         $text = LimeExpressionManager::ProcessString($text, null, $replacements, 2, 1, false, false, $staticReplace);
460     } else {
461         foreach ($fieldsarray as $key => $value) {
462             $text = str_replace($key, $value, (string) $text);
463         }
464     }
465     return $text;
466 }
467 
468 
469 /**
470 * passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables
471 *  which it then substitutes for parameter data sent in the initial URL and stored
472 *  in the session array containing responses
473 *
474 * @param mixed $line   string - the string to iterate, and then return

Stack Trace

#0
+
 /media/shnoulle/data/webdev/master/application/helpers/replacements_helper.php(462): str_replace("{EXPIRY}", null, "Einladung zu einer Umfrage")
457             $replacements[substr((string) $key, 1, -1)] = $value;
458         }
459         $text = LimeExpressionManager::ProcessString($text, null, $replacements, 2, 1, false, false, $staticReplace);
460     } else {
461         foreach ($fieldsarray as $key => $value) {
462             $text = str_replace($key, $value, (string) $text);
463         }
464     }
465     return $text;
466 }
467 
#1
+
 /media/shnoulle/data/webdev/master/application/views/admin/token/invite.php(106): ReplaceFields("Einladung zu einer Umfrage", array("{ADMINNAME}" => "Administrator", "{ADMINEMAIL}" => "denis@sondages.pro", "{SURVEYNAME}" => "Bootstrap Dropdown Demo Survey Dolorem facilis fuga harum accu...", "{SURVEYDESCRIPTION}" => "", ...), false)
101                                 $fieldsarray["{ADMINEMAIL}"] = $admin_email;
102                                 $fieldsarray["{SURVEYNAME}"] = $oSurvey->languagesettings[$language]->surveyls_title;
103                                 $fieldsarray["{SURVEYDESCRIPTION}"] = $oSurvey->languagesettings[$language]->surveyls_description;
104                                 $fieldsarray["{EXPIRY}"] = $oSurvey->expires;
105 
106                                 $subject = Replacefields($oSurvey->languagesettings[$language]->surveyls_email_invite_subj, $fieldsarray, false);
107                                 $textarea = Replacefields($oSurvey->languagesettings[$language]->surveyls_email_invite, $fieldsarray, false);
108                                 if ($ishtml !== true) {
109                                     $textarea = str_replace(array('<x>', '</x>'), array(''), (string) $textarea);
110                                 }
111                             ?>
#5
+
 /media/shnoulle/data/webdev/master/application/controllers/AdminController.php(261): CController->renderPartial("/admin/token/invite", array("sidemenu" => array("state" => false, "token_menu" => true, "landOnSideMenuTab" => "settings"), "title_bar" => array("title" => "Bootstrap Dropdown Demo Survey Dolorem facilis fuga harum accu..."), "thissurvey" => array("sid" => 893992, "owner_id" => 1, "gsid" => 1, "admin" => "Administrator", ...), "surveyid" => 893992, ...), true, false)
256                     $view = $sModulePath;
257                 }
258             }
259         }
260 
261         return parent::renderPartial($view, $data, $return, $processOutput);
262     }
263 
264     /**
265      * Routes all the actions to their respective places
266      *
2024-04-22 16:44:10 nginx/1.22.1 Yii Framework/1.1.29