From c8fb6ac87211e4f4c46a19dccb9442145db6c335 Mon Sep 17 00:00:00 2001 From: Berran Remzi <11856339+BerranRemzi@users.noreply.github.com> Date: Wed, 14 Jan 2026 00:07:05 +0200 Subject: [PATCH 1/2] Fix logical error in path validation for SD file handling --- esp3d/src/modules/http/handlers/handle-SD-files.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp3d/src/modules/http/handlers/handle-SD-files.cpp b/esp3d/src/modules/http/handlers/handle-SD-files.cpp index f3409b1f..7c09910e 100644 --- a/esp3d/src/modules/http/handlers/handle-SD-files.cpp +++ b/esp3d/src/modules/http/handlers/handle-SD-files.cpp @@ -100,7 +100,7 @@ void HTTP_Server::handleSDFileList() { status = shortname + " deleted"; // what happen if no "/." and no other subfiles for SPIFFS like? String ptmp = path; - if ((path != "/") && (path[path.length() - 1] = '/')) { + if ((path != "/") && (path[path.length() - 1] == '/')) { ptmp = path.substring(0, path.length() - 1); } if (!ESP_SD::exists(ptmp.c_str())) { @@ -160,7 +160,7 @@ void HTTP_Server::handleSDFileList() { buffer2send.reserve(1200); buffer2send = "{\"files\":["; String ptmp = path; - if ((path != "/") && (path[path.length() - 1] = '/')) { + if ((path != "/") && (path[path.length() - 1] == '/')) { ptmp = path.substring(0, path.length() - 1); } _webserver->setContentLength(CONTENT_LENGTH_UNKNOWN); From 5180706615b2d4802a4f8898e4d705c58f25cff3 Mon Sep 17 00:00:00 2001 From: Berran Remzi <11856339+BerranRemzi@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:31:44 +0200 Subject: [PATCH 2/2] Fix logical error in path validation for SPIFFS file handling --- esp3d/src/modules/http/handlers/handle-files.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp3d/src/modules/http/handlers/handle-files.cpp b/esp3d/src/modules/http/handlers/handle-files.cpp index 9505a715..234eb00c 100644 --- a/esp3d/src/modules/http/handlers/handle-files.cpp +++ b/esp3d/src/modules/http/handlers/handle-files.cpp @@ -88,7 +88,7 @@ void HTTP_Server::handleFSFileList() { status = shortname + " deleted"; // what happen if no "/." and no other subfiles for SPIFFS like? String ptmp = path; - if ((path != "/") && (path[path.length() - 1] = '/')) { + if ((path != "/") && (path[path.length() - 1] == '/')) { ptmp = path.substring(0, path.length() - 1); } if (!ESP_FileSystem::exists(ptmp.c_str())) { @@ -144,7 +144,7 @@ void HTTP_Server::handleFSFileList() { buffer2send.reserve(1200); buffer2send = "{\"files\":["; String ptmp = path; - if ((path != "/") && (path[path.length() - 1] = '/')) { + if ((path != "/") && (path[path.length() - 1] == '/')) { ptmp = path.substring(0, path.length() - 1); } _webserver->setContentLength(CONTENT_LENGTH_UNKNOWN);