Browse Source

Correction sur la fonction d'update BDD pour les prochains éléments à mettre à jour.

cobalt74 7 years ago
parent
commit
41748c0238
1 changed files with 8 additions and 8 deletions
  1. 8 8
      Update.class.php

+ 8 - 8
Update.class.php

@@ -47,18 +47,18 @@ class Update{
 
         $jsonFiles = Update::getUpdateFile();
 
-        $alreadyPassed = array();
         $notPassed = array();
 
-        if ($jsonFiles==''){
-            $jsonFiles[0] = array();
-        }
+        if ($jsonFiles=='') $jsonFiles[0] = array();
+
         foreach($files as $file){
-            if(in_array(basename($file), $jsonFiles[0])){
-                $alreadyPassed [] =  basename($file);
-            }else{
-                $notPassed [] =  basename($file);
+            $found = false;
+            foreach($jsonFiles as $jsonfile){
+                if (isset($jsonfile[0])) {
+                    if(in_array(basename($file), $jsonfile)) $found = true;
+                }
             }
+            if (!$found) $notPassed [] =  basename($file);
         }
         return $notPassed;
     }