mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-04 08:55:31 -05:00
Resolve reference in entry field, prevent recorsive loop, fix EditEntry association bug
This commit is contained in:
parent
536db062f4
commit
c5dd64d18a
@ -778,17 +778,30 @@ QString Entry::resolvePlaceholderRecursive(const QString& placeholder, int maxDe
|
||||
case PlaceholderType::Unknown:
|
||||
return placeholder;
|
||||
case PlaceholderType::Title:
|
||||
return title();
|
||||
if (placeholderType(title()) == PlaceholderType::Title) {
|
||||
return title();
|
||||
}
|
||||
return resolvePlaceholderRecursive(title(), maxDepth - 1);
|
||||
case PlaceholderType::UserName:
|
||||
return username();
|
||||
if (placeholderType(username()) == PlaceholderType::UserName) {
|
||||
return username();
|
||||
}
|
||||
return resolvePlaceholderRecursive(username(), maxDepth - 1);
|
||||
case PlaceholderType::Password:
|
||||
return password();
|
||||
if (placeholderType(password()) == PlaceholderType::Password) {
|
||||
return password();
|
||||
}
|
||||
return resolvePlaceholderRecursive(password(), maxDepth - 1);
|
||||
case PlaceholderType::Notes:
|
||||
return notes();
|
||||
case PlaceholderType::Totp:
|
||||
return totp();
|
||||
if (placeholderType(notes()) == PlaceholderType::Notes) {
|
||||
return notes();
|
||||
}
|
||||
return resolvePlaceholderRecursive(notes(), maxDepth - 1);
|
||||
case PlaceholderType::Url:
|
||||
return url();
|
||||
if (placeholderType(url()) == PlaceholderType::Url) {
|
||||
return url();
|
||||
}
|
||||
return resolvePlaceholderRecursive(url(), maxDepth - 1);
|
||||
case PlaceholderType::UrlWithoutScheme:
|
||||
case PlaceholderType::UrlScheme:
|
||||
case PlaceholderType::UrlHost:
|
||||
@ -802,6 +815,9 @@ QString Entry::resolvePlaceholderRecursive(const QString& placeholder, int maxDe
|
||||
const QString strUrl = resolveMultiplePlaceholdersRecursive(url(), maxDepth - 1);
|
||||
return resolveUrlPlaceholder(strUrl, typeOfPlaceholder);
|
||||
}
|
||||
case PlaceholderType::Totp:
|
||||
// totp can't have placeholder inside
|
||||
return totp();
|
||||
case PlaceholderType::CustomAttribute: {
|
||||
const QString key = placeholder.mid(3, placeholder.length() - 4); // {S:attr} => mid(3, len - 4)
|
||||
return attributes()->hasKey(key) ? attributes()->value(key) : QString();
|
||||
|
@ -188,6 +188,8 @@ void EditEntryWidget::setupAutoType()
|
||||
connect(m_autoTypeAssocModel, SIGNAL(modelReset()), SLOT(clearCurrentAssoc()));
|
||||
connect(m_autoTypeUi->windowTitleCombo, SIGNAL(editTextChanged(QString)),
|
||||
SLOT(applyCurrentAssoc()));
|
||||
connect(m_autoTypeUi->customWindowSequenceButton, SIGNAL(toggled(bool)),
|
||||
SLOT(applyCurrentAssoc()));
|
||||
connect(m_autoTypeUi->windowSequenceEdit, SIGNAL(textChanged(QString)),
|
||||
SLOT(applyCurrentAssoc()));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user