Load external references in encrypted emails only on explicit request.

Taken from KDE patches and adapted to TDE.
See https://phabricator.kde.org/D12391

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 746e02af07)
r14.0.x
Slávek Banko 2 years ago
parent 2b133a2d1d
commit b1ef270c61
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1401,8 +1401,6 @@ void KMReaderWin::updateReaderWin()
{
if (!mMsgDisplay) return;
mViewer->setOnlyLocalReferences(!htmlLoadExternal());
htmlWriter()->reset();
KMFolder* folder = 0;
@ -1565,6 +1563,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg)
// - this can only be done *after* calling parseObjectTree()
KMMsgEncryptionState encryptionState = mRootNode->overallEncryptionState();
KMMsgSignatureState signatureState = mRootNode->overallSignatureState();
mViewer->setOnlyLocalReferences(!htmlLoadExternal());
// Don't crash when switching message while GPG passphrase entry dialog is shown #53185
if (aMsg != message()) {
displayMessage();
@ -2490,8 +2489,19 @@ bool KMReaderWin::htmlMail()
//-----------------------------------------------------------------------------
bool KMReaderWin::htmlLoadExternal()
{
return ((mHtmlLoadExternal && !mHtmlLoadExtOverride) ||
(!mHtmlLoadExternal && mHtmlLoadExtOverride));
if (!mRootNode)
{
return mHtmlLoadExtOverride;
}
// when displaying an encrypted message, only load external resources on explicit request
if (mRootNode->overallEncryptionState() != KMMsgNotEncrypted)
{
return mHtmlLoadExtOverride;
}
return ((mHtmlLoadExternal && !mHtmlLoadExtOverride) ||
(!mHtmlLoadExternal && mHtmlLoadExtOverride));
}

Loading…
Cancel
Save