mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
Merge pull request #2242 from pmzqla/webui-password
Don't overwrite WebUI password when changing preferences
This commit is contained in:
commit
541cc4db24
1 changed files with 4 additions and 0 deletions
|
@ -958,6 +958,10 @@ QString Preferences::getWebUiPassword() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::setWebUiPassword(const QString &new_password) {
|
void Preferences::setWebUiPassword(const QString &new_password) {
|
||||||
|
// Do not overwrite current password with its hash
|
||||||
|
if (new_password == getWebUiPassword())
|
||||||
|
return;
|
||||||
|
|
||||||
// Encode to md5 and save
|
// Encode to md5 and save
|
||||||
QCryptographicHash md5(QCryptographicHash::Md5);
|
QCryptographicHash md5(QCryptographicHash::Md5);
|
||||||
md5.addData(new_password.toLocal8Bit());
|
md5.addData(new_password.toLocal8Bit());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue