Small code fixes in API code

This commit is contained in:
2026-06-15 16:04:21 +02:00
parent 7429cd367d
commit 16be5448be
20 changed files with 64 additions and 75 deletions

View File

@@ -94,7 +94,7 @@ if ($API_devices->request_method === 'POST') {
$requestedPath = realpath($_SERVER['DOCUMENT_ROOT'] . $relativePath);
// Validate resolved path
if (!$requestedPath || strpos($requestedPath, $root) !== 0) {
if (!$requestedPath || !str_starts_with($requestedPath, $root)) {
http_response_code(403);
echo json_encode(['status' => 'error', 'message' => 'Access denied']);
exit;