Skip to content

Commit 5a922ff

Browse files
committed
cipher: Fix passphrases containing single quotes
This fixes a regression introduced in d1e3e98 which makes it impossible to open encrypted databases with single quote characters in their passphrase. See issue #1105.
1 parent 516ff44 commit 5a922ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CipherDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CipherDialog::KeyFormats CipherDialog::keyFormat() const
4040
QString CipherDialog::password() const
4141
{
4242
if(keyFormat() == KeyFormats::Passphrase)
43-
return QString("'%1'").arg(ui->editPassword->text());
43+
return QString("'%1'").arg(ui->editPassword->text().replace("'", "''"));
4444
else
4545
return QString("\"x'%1'\"").arg(ui->editPassword->text().mid(2)); // Remove the '0x' part at the beginning
4646
}

0 commit comments

Comments
 (0)