jerry 1 anno fa
parent
commit
6f36253c66
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      common/helpers/Tool.php

+ 6 - 1
common/helpers/Tool.php

@@ -576,12 +576,17 @@ class Tool {
         return true;
     }
 
-    function checkArrayElementSubstringOfString($string, $array) {
+    function checkArrayElementSubstringOfString(string $string, array $array) {
+        if (empty($string) || empty($array)) {
+            return false;
+        }
+
         foreach ($array as $substr) {
             if (strpos($string, $substr) !== false) {
                 return true;
             }
         }
+        
         return false;
     }