Update KeePassImporter.cs (#1146)

This commit is contained in:
Leendert de Borst
2025-08-26 15:17:20 +02:00
committed by Leendert de Borst
parent 2fccb162e6
commit 8cd5118749

View File

@@ -53,6 +53,18 @@ public static class KeePassImporter
decoded = Regex.Replace(decoded, @"\\(?![\\\""])", "\"");
}
// Handle edge case where CSV parser incorrectly includes trailing quotes
// This happens when the CSV parser gets confused by escaped quotes inside quoted fields
if (decoded.EndsWith("\""))
{
// Check if this is likely a CSV parsing error (trailing quote that shouldn't be there)
// Look for patterns like: some content" at the end
if (decoded.Length > 1 && !decoded.EndsWith("\"\""))
{
decoded = decoded.Substring(0, decoded.Length - 1);
}
}
return decoded;
}