]> _ Git - fluidbook-toolbox.git/commitdiff
#7414 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 1 Apr 2025 14:22:32 +0000 (16:22 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 1 Apr 2025 14:22:32 +0000 (16:22 +0200)
app/Http/Controllers/Admin/TeamPayController.php

index 5363f3db950a44ce487a78baa521770318f7277d..63b8b1ee481a830459ff7e62d5fcd5d8bc652def 100644 (file)
@@ -55,10 +55,18 @@ class TeamPayController extends Controller
         foreach ($iterator as $item) {
             /** @var $item \SplFileInfo */
             $n = $item->getFilename();
-            if (mb_strtolower($item->getExtension()) === 'pdf' && ($id === 'all' || str_starts_with($n, $id))) {
-                $year = substr($n, 4, 4);
-                $month = substr($n, 8, 2);
-                $oxygene = substr($n, 0, 3);
+
+            if (preg_match('/([A-Z]{3})\s([0-9]{4})([0-9IR]{2}).pdf/i', $n, $m)) {
+                $oxygene = $m[1];
+                $year = $m[2];
+                $month = $m[3];
+            } else if (preg_match('/([0-9]{4})([0-9IR]{2})\s([A-Z]{3}).pdf/i', $n, $m)) {
+                $oxygene = $m[3];
+                $year = $m[1];
+                $month = $m[2];
+            }
+
+            if (mb_strtolower($item->getExtension()) === 'pdf' && ($id === 'all' || $oxygene == $id)) {
                 $res[$year . $month . $oxygene] = ['name' => $names[$oxygene] ?? $oxygene, 'oxygene' => $oxygene, 'path' => $item->getPathname(), 'updated' => $item->getMTime(), 'year' => $year, 'month' => $month];
             }
         }