mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-29 21:33:13 -08:00
Add support for URL wildcards and exact URL (#9835)
* Add support for URL wildcards with Additional URL feature * Only check TLD if wildcard is used * Avoid using network function in no-feature build --------- Co-authored-by: varjolintu <[email protected]> Co-authored-by: Jonathan White <[email protected]>
This commit is contained in:
11 files changed
+317
-36
No files matched your search
+19
-3
@@ -381,16 +381,32 @@ QString Entry::url() const
|
||||
return m_attributes->value(EntryAttributes::URLKey);
|
||||
}
|
||||
|
||||
QString Entry::resolveUrl() const
|
||||
{
|
||||
const auto entryUrl = url();
|
||||
if (entryUrl.isEmpty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return EntryAttributes::matchReference(entryUrl).hasMatch() ? resolveMultiplePlaceholders(entryUrl) : entryUrl;
|
||||
}
|
||||
|
||||
QStringList Entry::getAllUrls() const
|
||||
{
|
||||
QStringList urlList;
|
||||
auto entryUrl = url();
|
||||
|
||||
const auto entryUrl = resolveUrl();
|
||||
if (!entryUrl.isEmpty()) {
|
||||
urlList << (EntryAttributes::matchReference(entryUrl).hasMatch() ? resolveMultiplePlaceholders(entryUrl)
|
||||
: entryUrl);
|
||||
urlList << entryUrl;
|
||||
}
|
||||
|
||||
return urlList << getAdditionalUrls();
|
||||
}
|
||||
|
||||
QStringList Entry::getAdditionalUrls() const
|
||||
{
|
||||
QStringList urlList;
|
||||
|
||||
for (const auto& key : m_attributes->keys()) {
|
||||
if (key.startsWith(EntryAttributes::AdditionalUrlAttribute)
|
||||
|| key == QString("%1_RELYING_PARTY").arg(EntryAttributes::PasskeyAttribute)) {
|
||||
|
||||
Reference in new issue
Block a user