Compatibilty PHP8.1 deprecated explode with NULL

This commit is contained in:
Dany De Bontridder 2022-09-03 18:45:12 +02:00 committed by sparkyx
parent 407e056710
commit f0c744c36f

View file

@ -1610,4 +1610,15 @@ function noalyss_strip_tags($p_string)
{
if ($p_string===null) return "";
return strip_tags($p_string);
}
/**
* to avoid deprecated in PHP8.1 : explode cannot use a null
* @param $separator
* @param $string
* @return array | empty string
*/
function noalyss_explode($separator,$string) {
if ($string===null) return '';
return explode($separator,$string);
}