Skip to content

Commit

Permalink
Prevent duplicate characters in "Also choose from" field of password …
Browse files Browse the repository at this point in the history
…generator (#9803)

* Fixes #9797
  • Loading branch information
f4lkensmaz3 authored Jan 6, 2024
1 parent 07232f0 commit ce01f6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/PasswordGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,10 @@ QVector<PasswordGroup> 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);
Expand Down

0 comments on commit ce01f6d

Please sign in to comment.