noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/07: Compatibilty PHP8.1 deprecated explode


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/07: Compatibilty PHP8.1 deprecated explode with NULL
Date: Sat, 3 Sep 2022 17:16:03 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit f0c744c36f090b70cebbb8e2473e39b2b779bade
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Sat Sep 3 18:45:12 2022 +0200

    Compatibilty PHP8.1 deprecated explode with NULL
---
 include/lib/ac_common.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index cbb5a9a51..16ffa8949 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -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);
 }
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]