Compatibilty PHP8.1 deprecated explode with NULL
This commit is contained in:
parent
407e056710
commit
f0c744c36f
1 changed files with 11 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue