fix: revert overly strict isAllowedLocalReadPath to OR logic

The AND gate broke access to user-selected files outside the allowlist
(wallpapers, user videos, etc). Keep isPathInsideDirectory normalization fix,
revert the existsSync AND guard back to the original OR behavior.
This commit is contained in:
webadderall
2026-04-17 20:56:50 +10:00
parent 2ae0aa9a92
commit 87ec8fca93
+3 -3
View File
@@ -53,9 +53,9 @@ export function isAllowedLocalReadPath(candidatePath: string) {
const allowedPrefixes = [RECORDINGS_DIR, USER_DATA_PATH, getAssetRootPath(), app.getPath("temp")];
return (
existsSync(candidatePath) &&
(allowedPrefixes.some((prefix) => isPathInsideDirectory(candidatePath, prefix)) ||
approvedLocalReadPaths.has(candidatePath))
existsSync(candidatePath) ||
allowedPrefixes.some((prefix) => isPathInsideDirectory(candidatePath, prefix)) ||
approvedLocalReadPaths.has(candidatePath)
);
}