Bug 415254 - [regression] HTML viewer complains about "external references to images etc." when there are no images
Summary: [regression] HTML viewer complains about "external references to images etc."...
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: message list (show other bugs)
Version: 5.12.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-16 18:09 UTC by Thiago Macieira
Modified: 2019-12-19 07:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.13.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Macieira 2019-12-16 18:09:52 UTC
SUMMARY
When viewing ANY HTML email, KMail displays

Note: This HTML message may contain external references to images etc. For security/privacy reasons external references are not loaded. If you trust the sender of this message then you can load the external references for this message by clicking here.

Up until last week (19.08), this message only showed if there were image links to non-attached images. This also correlates with a change in style: up until last week, it displayed in a white background inside a red outline, now (19.12) it's got a reddish background.

STEPS TO REPRODUCE
1. Send yourself an HTML email with no images
2. Open it in KMail

OBSERVED RESULT
The message appears at the top.

EXPECTED RESULT
No message appears.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.17.4
KDE Frameworks: 5.64.0
Qt: 5.13.1

ADDITIONAL INFORMATION
Comment 1 Laurent Montel 2019-12-17 05:50:18 UTC
I confirm it.
I will work on it soon.
Comment 2 Laurent Montel 2019-12-17 06:07:11 UTC
Git commit 56f1d42f68ed2f597fc599e4952ee81e579cd355 by Laurent Montel.
Committed on 17/12/2019 at 06:05.
Pushed by mlaurent into branch 'release/19.12'.

Fix Bug 415254 - [regression] HTML viewer complains about "external references to images etc." when there are no images

FIXED-IN: 5.13.1

M  +2    -2    messageviewer/src/messagepartthemes/default/defaultrenderer.cpp

https://commits.kde.org/messagelib/56f1d42f68ed2f597fc599e4952ee81e579cd355
Comment 3 Thiago Macieira 2019-12-17 06:45:16 UTC
(In reply to Laurent Montel from comment #2)
> Git commit 56f1d42f68ed2f597fc599e4952ee81e579cd355 by Laurent Montel.
> Committed on 17/12/2019 at 06:05.
> Pushed by mlaurent into branch 'release/19.12'.
> 
> Fix Bug 415254 - [regression] HTML viewer complains about "external
> references to images etc." when there are no images
> 
> FIXED-IN: 5.13.1
> 
> M  +2    -2   
> messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
> 
> https://commits.kde.org/messagelib/56f1d42f68ed2f597fc599e4952ee81e579cd355

+    if (str.contains(QRegularExpression(QLatin1String("<img.*src=http:/"), QRegularExpression::CaseInsensitiveOption))
+        || str.contains(QRegularExpression(QLatin1String("<img.*src=https:/"), QRegularExpression::CaseInsensitiveOption))) {

How about <img src="https://...">, with the quotes? The code above this section deals with href=", but not src=. 

This will also trigger as a false positive in the following HTML:

<img src="cid:parn-num">Some text goes here blah blah src=http://example.com
Comment 4 Laurent Montel 2019-12-17 08:17:25 UTC
Hum... indeed.
I will improve check.
Comment 5 Laurent Montel 2019-12-17 12:36:47 UTC
Git commit e7a170f39c26ee7d4a180724c813e65331727492 by Laurent Montel.
Committed on 17/12/2019 at 12:36.
Pushed by mlaurent into branch 'master'.

Test excludeExtraHeader. Need to improve regexp.

M  +1    -52   messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
M  +1    -0    messageviewer/src/utils/autotests/CMakeLists.txt
A  +6    -0    messageviewer/src/utils/autotests/data/image.txt
A  +6    -0    messageviewer/src/utils/autotests/data/image2.txt
A  +5    -0    messageviewer/src/utils/autotests/data/noimage.txt
A  +3    -0    messageviewer/src/utils/autotests/data/noimage2.txt
A  +3    -0    messageviewer/src/utils/autotests/data/noimage3.txt
M  +29   -0    messageviewer/src/utils/autotests/messageviewerutilstest.cpp
M  +3    -0    messageviewer/src/utils/autotests/messageviewerutilstest.h
M  +50   -0    messageviewer/src/utils/messageviewerutil.cpp
M  +1    -0    messageviewer/src/utils/messageviewerutil.h

https://commits.kde.org/messagelib/e7a170f39c26ee7d4a180724c813e65331727492
Comment 6 Laurent Montel 2019-12-17 12:38:24 UTC
Git commit 34ab26ced039167a87f71a8b0a39630480305d99 by Laurent Montel.
Committed on 17/12/2019 at 12:38.
Pushed by mlaurent into branch 'release/19.12'.

Test excludeExtraHeader. Need to improve regexp.
(cherry picked from commit e7a170f39c26ee7d4a180724c813e65331727492)

M  +1    -52   messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
M  +1    -0    messageviewer/src/utils/autotests/CMakeLists.txt
A  +6    -0    messageviewer/src/utils/autotests/data/image.txt
A  +6    -0    messageviewer/src/utils/autotests/data/image2.txt
A  +5    -0    messageviewer/src/utils/autotests/data/noimage.txt
A  +3    -0    messageviewer/src/utils/autotests/data/noimage2.txt
A  +3    -0    messageviewer/src/utils/autotests/data/noimage3.txt
M  +29   -0    messageviewer/src/utils/autotests/messageviewerutilstest.cpp
M  +3    -0    messageviewer/src/utils/autotests/messageviewerutilstest.h
M  +50   -0    messageviewer/src/utils/messageviewerutil.cpp
M  +1    -0    messageviewer/src/utils/messageviewerutil.h

https://commits.kde.org/messagelib/34ab26ced039167a87f71a8b0a39630480305d99
Comment 7 Laurent Montel 2019-12-19 07:22:59 UTC
Git commit b551d400afe823b4357b9e3a0ed7ba233e27a77e by Laurent Montel.
Committed on 19/12/2019 at 07:22.
Pushed by mlaurent into branch 'release/19.12'.

Fix Bug 415254 - [regression] HTML viewer complains about "external references to images etc." when there are no images

FIXED-IN: 5.13.1

M  +0    -3    messageviewer/src/utils/autotests/messageviewerutilstest.cpp
M  +23   -4    messageviewer/src/utils/messageviewerutil.cpp

https://commits.kde.org/messagelib/b551d400afe823b4357b9e3a0ed7ba233e27a77e