: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace NinjaForms\Includes\Handlers;
* Sanitize output for enhanced functionality while maintaining security
const DISALLOWED_SCRIPT_TRIGGERS=[
'/<\s*(script)/i', // < script (includes empty spaces after opening tag)
'/(onload)/i', // word 'onload'
'/(onerror)/i', // word 'onerror'
'/(onfocus)/i', // word 'onfocus'
'/(javascript)/i' // word 'javascript'
* Block disallowed script triggering text
public static function preventScriptTriggerInHtmlOutput(string $string): string
foreach(self::DISALLOWED_SCRIPT_TRIGGERS as $disallowedString){
$preg_match = preg_match($disallowedString,$string);
$return = htmlspecialchars($return,\ENT_QUOTES);