jerry hai 1 ano
pai
achega
6f36253c66
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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;
     }