Fix readFiles method to correctly filter .txt files by adding missing slash in path
This commit is contained in:
@@ -62,8 +62,9 @@ class SapFileController extends Controller
|
|||||||
// return $file !== '.' && $file !== '..' && is_file($path . $file)
|
// return $file !== '.' && $file !== '..' && is_file($path . $file)
|
||||||
// && pathinfo($file, PATHINFO_EXTENSION) === 'txt';
|
// && pathinfo($file, PATHINFO_EXTENSION) === 'txt';
|
||||||
// });
|
// });
|
||||||
$files = array_filter(scandir($path), function($item) use ($path) {
|
$files = array_filter($allFiles, function($item) use ($path) {
|
||||||
return is_file($path . $item) && pathinfo($item, PATHINFO_EXTENSION) === 'txt';
|
$fullPath = $path . '/' . $item; // Add the missing slash
|
||||||
|
return is_file($fullPath) && pathinfo($item, PATHINFO_EXTENSION) === 'txt';
|
||||||
});
|
});
|
||||||
|
|
||||||
if (empty($files)) {
|
if (empty($files)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user