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
Plasma
Discover
Commits
d375031f
Commit
d375031f
authored
Mar 10, 2021
by
Aleix Pol Gonzalez
🐧
Committed by
Albert Astals Cid
Mar 10, 2021
Browse files
Only turn http[s] links into clickable links
CVE-2021-28117
parent
3f865a87
Changes
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/backends/KNSBackend/KNSResource.cpp
View file @
d375031f
...
...
@@ -87,7 +87,7 @@ QString KNSResource::longDescription()
ret
.
remove
(
QRegularExpression
(
QStringLiteral
(
"
\\
[
\\
/?[a-z]*
\\
]"
)));
// Find anything that looks like a link (but which also is not some html
// tag value or another already) and make it a link
static
const
QRegularExpression
urlRegExp
(
QStringLiteral
(
"(^|
\\
s)([-a-zA-Z0-9@:%_
\\
+.~#?&//=]{2,256}
\\
.[a-z]{2,4}
\\
b(
\\
/[-a-zA-Z0-9@:;%_
\\
+.~#?&//=]*)?)"
),
QRegularExpression
::
CaseInsensitiveOption
);
static
const
QRegularExpression
urlRegExp
(
QStringLiteral
(
"(^|
\\
s)(
http
[-a-zA-Z0-9@:%_
\\
+.~#?&//=]{2,256}
\\
.[a-z]{2,4}
\\
b(
\\
/[-a-zA-Z0-9@:;%_
\\
+.~#?&//=]*)?)"
),
QRegularExpression
::
CaseInsensitiveOption
);
ret
.
replace
(
urlRegExp
,
QStringLiteral
(
"<a href=
\"\\
2
\"
>
\\
2</a>"
));
return
ret
;
}
...
...
Aleix Pol Gonzalez
🐧
@apol
mentioned in commit
94478827
·
Mar 10, 2021
mentioned in commit
94478827
mentioned in commit 94478827aab63d2e2321f0ca9ec5553718798e60
Toggle commit list
Aleix Pol Gonzalez
🐧
@apol
mentioned in commit
fcd3b305
·
Mar 10, 2021
mentioned in commit
fcd3b305
mentioned in commit fcd3b30552bf03a384b1a16f9bb8db029c111356
Toggle commit list
Write
Preview
Supports
Markdown
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