Fix argument parsing for OTP TOTP URL's

* Fixes #2915
This commit is contained in:
Jonathan White 2019-05-30 18:43:33 -04:00
parent 96b0ea45dd
commit 6f443ee9fc

View File

@ -128,9 +128,9 @@ QString Totp::writeSettings(const QSharedPointer<Totp::Settings>& settings,
auto urlstring = QString("otpauth://totp/%1:%2?secret=%3&period=%4&digits=%5&issuer=%1")
.arg(title.isEmpty() ? "KeePassXC" : QString(QUrl::toPercentEncoding(title)),
username.isEmpty() ? "none" : QString(QUrl::toPercentEncoding(username)),
QString(Base32::sanitizeInput(settings->key.toLatin1())))
.arg(settings->step)
.arg(settings->digits);
QString(Base32::sanitizeInput(settings->key.toLatin1())),
QString::number(settings->step),
QString::number(settings->digits));
if (!settings->encoder.name.isEmpty()) {
urlstring.append("&encoder=").append(settings->encoder.name);