diff --git a/app/Services/FileService.php b/app/Services/FileService.php index 39f1e66..9ad8984 100644 --- a/app/Services/FileService.php +++ b/app/Services/FileService.php @@ -1206,7 +1206,7 @@ class FileService { } if (is_file($currentItem)) { $pathInfo = pathinfo($currentItem); - if (in_array($pathInfo[PATHINFO_EXTENSION], $extensions)) { + if (in_array($pathInfo["extension"], $extensions)) { dump("now delete file $currentItem"); unlink($currentItem); } @@ -1231,7 +1231,7 @@ class FileService { } if (is_file($currentItem)) { $pathInfo = pathinfo($currentItem); - if ($pathInfo[PATHINFO_EXTENSION] == $fromExtension) { + if ($pathInfo["extension"] == $fromExtension) { $newFile = str_replace($fromExtension, $toExtension, $currentItem); dump("now rename file $currentItem to $newFile"); rename($currentItem, $newFile); @@ -1246,7 +1246,7 @@ class FileService { { if (is_file($file)) { $pathInfo = pathinfo($file); - if ($pathInfo[PATHINFO_EXTENSION] == $fromExtension) { + if ($pathInfo["extension"] == $fromExtension) { $newFile = str_replace($fromExtension, $toExtension, $file); dump("now rename file $file to $newFile"); rename($file, $newFile);