mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-31 10:39:14 -04:00
Prompt the user before executing a command in a cmd:// URL
Fixes #51. (Does not have a "don't ask me anymore" option.)
This commit is contained in:
parent
cdaab550e9
commit
7ea306a61a
1 changed files with 10 additions and 1 deletions
|
@ -497,9 +497,18 @@ void DatabaseWidget::openUrlForEntry(Entry* entry)
|
||||||
|
|
||||||
if (urlString.startsWith("cmd://")) {
|
if (urlString.startsWith("cmd://")) {
|
||||||
if (urlString.length() > 6) {
|
if (urlString.length() > 6) {
|
||||||
|
QMessageBox::StandardButton result;
|
||||||
|
result = MessageBox::question(
|
||||||
|
this, tr("Execute command?"),
|
||||||
|
tr("Do you really want to execute the following command?<br><br>%1")
|
||||||
|
.arg(urlString.left(200).toHtmlEscaped()),
|
||||||
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|
||||||
|
if (result == QMessageBox::Yes) {
|
||||||
QProcess::startDetached(urlString.mid(6));
|
QProcess::startDetached(urlString.mid(6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
QUrl url = QUrl::fromUserInput(urlString);
|
QUrl url = QUrl::fromUserInput(urlString);
|
||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue