mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-23 15:00:40 -04:00
Sanitize output from Helper.urls2links
This commit is contained in:
parent
25a39148a8
commit
5f0011b0f6
1 changed files with 5 additions and 3 deletions
|
@ -405,10 +405,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
||||||
me.urls2links = function(element)
|
me.urls2links = function(element)
|
||||||
{
|
{
|
||||||
element.html(
|
element.html(
|
||||||
|
DOMPurify.sanitize(
|
||||||
element.html().replace(
|
element.html().replace(
|
||||||
/(((https?|ftp):\/\/[\w?!=&.\/-;#@~%+*-]+(?![\w\s?!&.\/;#~%"=-]>))|((magnet):[\w?=&.\/-;#@~%+*-]+))/ig,
|
/(((https?|ftp):\/\/[\w?!=&.\/-;#@~%+*-]+(?![\w\s?!&.\/;#~%"=-]>))|((magnet):[\w?=&.\/-;#@~%+*-]+))/ig,
|
||||||
'<a href="$1" rel="nofollow">$1</a>'
|
'<a href="$1" rel="nofollow">$1</a>'
|
||||||
)
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue