From 7314776057754815df788fb7b9cb2fdecf056fd9 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Sat, 8 Nov 2025 19:08:41 +0100 Subject: [PATCH] Improves output folder path normalization Enhances path handling by skipping normalization of absolute paths to preserve leading slashes. This prevents potential validation errors when checking output folder paths. This change increases accuracy and reliability of the path validation logic. --- src/ui/modal/sections/GeneralSection.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/modal/sections/GeneralSection.ts b/src/ui/modal/sections/GeneralSection.ts index 929b790..ccf4a28 100644 --- a/src/ui/modal/sections/GeneralSection.ts +++ b/src/ui/modal/sections/GeneralSection.ts @@ -106,9 +106,11 @@ export class GeneralSection implements ModalSection { // Validate output folder if (this.outputFolderInput) { - const value = normalizePath(this.outputFolderInput.value.trim()); - if (!SecurityUtils.validateOutputPath(value)) { - errors.push(SecurityUtils.getPathValidationError(value)); + const rawValue = this.outputFolderInput.value.trim(); + // Don't normalize absolute paths as normalizePath strips the leading slash + const normalizedValue = path.isAbsolute(rawValue) ? rawValue : normalizePath(rawValue); + if (!SecurityUtils.validateOutputPath(normalizedValue)) { + errors.push(SecurityUtils.getPathValidationError(normalizedValue)); } }