mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
Merge pull request #2242 from pmzqla/webui-password
Don't overwrite WebUI password when changing preferences
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user