Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e753b85 authored by Nivesh Krishna's avatar Nivesh Krishna Committed by Arnau Vàzquez
Browse files

skip all files that are not e-number-*.zip

parent e51926ec
Loading
Loading
Loading
Loading
+23 −32
Original line number Original line Diff line number Diff line
@@ -176,19 +176,11 @@
            if (count($files) > 2) {
            if (count($files) > 2) {
                
                
                foreach ($files as $file) {
                foreach ($files as $file) {
                    $filename = pathinfo($file, PATHINFO_FILENAME);
                    // Skip all files except for the ones that match the pattern

                    // filename starting with e- and ending with .zip are considered as valid files
                    if (preg_match("/IMG/i", $filename)) {
                    if (!preg_match("/^e-[0-9\.]+-(.*)-$device\.zip$/i", $file)) {
                        continue;
                    }
                    
                    if (preg_match("/latest/i", $filename)) {
                        continue;
                        continue;
                    }
                    }

                    $extension = pathinfo($file, PATHINFO_EXTENSION);

                    if ($extension == 'zip') {
                    $build = null;
                    $build = null;


                    // If APC is enabled
                    // If APC is enabled
@@ -216,7 +208,6 @@
                    }
                    }
                }
                }
            }
            }
            }
            $this->logger->debug('Total execution  time  of getBuilds in seconds');
            $this->logger->debug('Total execution  time  of getBuilds in seconds');
        }
        }