From ce01f6d7cd97e7b167adbeedbd23b38885e097f1 Mon Sep 17 00:00:00 2001 From: f4lkensmaz3 <96619492+f4lkensmaz3@users.noreply.github.com> Date: Sat, 6 Jan 2024 21:54:30 +0000 Subject: [PATCH] Prevent duplicate characters in "Also choose from" field of password generator (#9803) * Fixes #9797 --- src/core/PasswordGenerator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/PasswordGenerator.cpp b/src/core/PasswordGenerator.cpp index 01641bc80..aa0f3e717 100644 --- a/src/core/PasswordGenerator.cpp +++ b/src/core/PasswordGenerator.cpp @@ -261,8 +261,10 @@ QVector PasswordGenerator::passwordGroups() const if (!m_custom.isEmpty()) { PasswordGroup group; - for (auto ch : m_custom) { - group.append(ch); + for (const auto& ch : m_custom) { + if (!group.contains(ch)) { + group.append(ch); + } } passwordGroups.append(group);