mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
cipher: Fix passphrases containing single quotes
This fixes a regression introduced in d1e3e98006 which makes it
impossible to open encrypted databases with single quote characters in
their passphrase.
See issue #1105.
This commit is contained in:
@@ -40,7 +40,7 @@ CipherDialog::KeyFormats CipherDialog::keyFormat() const
|
||||
QString CipherDialog::password() const
|
||||
{
|
||||
if(keyFormat() == KeyFormats::Passphrase)
|
||||
return QString("'%1'").arg(ui->editPassword->text());
|
||||
return QString("'%1'").arg(ui->editPassword->text().replace("'", "''"));
|
||||
else
|
||||
return QString("\"x'%1'\"").arg(ui->editPassword->text().mid(2)); // Remove the '0x' part at the beginning
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user