mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-27 10:00:38 -05:00
Resolve placeholders in entry details url
This commit is contained in:
parent
8416d69f1e
commit
b9fd609bb2
3 changed files with 19 additions and 4 deletions
|
|
@ -110,10 +110,17 @@ void DetailsWidget::getSelectedEntry(Entry* selectedEntry)
|
|||
}
|
||||
|
||||
QString url = m_currentEntry->webUrl();
|
||||
if (url != "") {
|
||||
url = QString("<a href=\"%1\">%2</a>").arg(url).arg(shortUrl(url));
|
||||
if (!url.isEmpty()) {
|
||||
// URL is well formed and can be opened in a browser
|
||||
// create a new display url that masks password placeholders
|
||||
// the actual link will use the password
|
||||
QString displayUrl = m_currentEntry->url();
|
||||
displayUrl = m_currentEntry->maskPasswordPlaceholders(displayUrl);
|
||||
displayUrl = m_currentEntry->resolveMultiplePlaceholders(displayUrl);
|
||||
url = QString("<a href=\"%1\">%2</a>").arg(url).arg(shortUrl(displayUrl));
|
||||
m_ui->urlLabel->setOpenExternalLinks(true);
|
||||
} else {
|
||||
// Fallback to the raw url string
|
||||
url = shortUrl(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->url()));
|
||||
m_ui->urlLabel->setOpenExternalLinks(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue