SystemStatus: glob() produces a full pathname, use basename instead of str_replace

This commit is contained in:
Stephan de Wit 2023-01-25 13:28:18 +01:00
parent b6a097c7b4
commit 90d978c5cc

View File

@ -53,7 +53,7 @@ class SystemStatus
$all = glob(__DIR__ . '/Status/*.php');
$classes = array_map(function ($file) {
if (strpos($file, 'Status') !== false) {
return '\\OPNsense\\System\\Status\\' . str_replace('.php', '', $file);
return '\\OPNsense\\System\\Status\\' . basename($file, '.php');
}
}, $all);