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.
This commit is contained in:
AlexKucera committed 2025-11-08 19:08:41 +01:00
1 parent 6c28b82a16
commit 7314776057
1 file changed
+5 -3
+5 -3
View File
@@ -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));
}
}