Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
a6eacf6e
Commit
a6eacf6e
authored
Oct 09, 2019
by
Laurent Montel
😁
Browse files
Fix search external reference
Bug found by Filipe Azevedo
parent
d5e666ea
Changes
1
Show whitespace changes
Inline
Side-by-side
messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
View file @
a6eacf6e
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#include <KEmailAddress>
#include <KEmailAddress>
#include <KIconLoader>
#include <KIconLoader>
#include <KLocalizedString>
#include <KLocalizedString>
#include <QRegularExpression>
#include <QUrl>
#include <QUrl>
...
@@ -256,7 +257,6 @@ bool containsExternalReferences(const QString &str, const QString &extraHead)
...
@@ -256,7 +257,6 @@ bool containsExternalReferences(const QString &str, const QString &extraHead)
}
}
int
httpPos
=
str
.
indexOf
(
QLatin1String
(
"
\"
http:"
),
Qt
::
CaseInsensitive
);
int
httpPos
=
str
.
indexOf
(
QLatin1String
(
"
\"
http:"
),
Qt
::
CaseInsensitive
);
int
httpsPos
=
str
.
indexOf
(
QLatin1String
(
"
\"
https:"
),
Qt
::
CaseInsensitive
);
int
httpsPos
=
str
.
indexOf
(
QLatin1String
(
"
\"
https:"
),
Qt
::
CaseInsensitive
);
while
(
httpPos
>=
0
||
httpsPos
>=
0
)
{
while
(
httpPos
>=
0
||
httpsPos
>=
0
)
{
// pos = index of next occurrence of "http: or "https: whichever comes first
// pos = index of next occurrence of "http: or "https: whichever comes first
int
pos
=
(
httpPos
<
httpsPos
)
int
pos
=
(
httpPos
<
httpsPos
)
...
@@ -286,6 +286,10 @@ bool containsExternalReferences(const QString &str, const QString &extraHead)
...
@@ -286,6 +286,10 @@ bool containsExternalReferences(const QString &str, const QString &extraHead)
httpsPos
=
str
.
indexOf
(
QLatin1String
(
"
\"
https:"
),
httpsPos
+
7
,
Qt
::
CaseInsensitive
);
httpsPos
=
str
.
indexOf
(
QLatin1String
(
"
\"
https:"
),
httpsPos
+
7
,
Qt
::
CaseInsensitive
);
}
}
}
}
if
(
str
.
indexOf
(
QRegularExpression
(
QLatin1String
(
"<img.*src=http:/"
),
QRegularExpression
::
CaseInsensitiveOption
))
||
str
.
indexOf
(
QRegularExpression
(
QLatin1String
(
"<img.*src=https:/"
),
QRegularExpression
::
CaseInsensitiveOption
)))
{
return
true
;
}
return
false
;
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment