From 7cb830e22fe8aae76498d116f20e68d0f711eeae Mon Sep 17 00:00:00 2001 From: rugk Date: Wed, 4 Mar 2020 11:45:56 +0100 Subject: [PATCH] It includes a change in the RegEx for URLs because that was broken when a & character later followed at any time after a link (even after a newline). (with a negative lookahead) Test with https://regex101.com/r/i7bZ73/1 Now the RegEx does not check for _all_ chars after a link, but just for the one following the link. (So the lookahead is not * anymore. I guess thsi behaviour was the expectation when it has been implemented.) --- js/privatebin.js | 2 +- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 65b407e3..c6b98b9b 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -392,7 +392,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { { element.html( element.html().replace( - /(((https?|ftp):\/\/[\w?!=&.\/-;#@~%+*-]+(?![\w\s?!&.\/;#~%"=-]*>))|((magnet):[\w?=&.\/-;#@~%+*-]+))/ig, + /(((https?|ftp):\/\/[\w?!=&.\/-;#@~%+*-]+(?![\w\s?!&.\/;#~%"=-]>))|((magnet):[\w?=&.\/-;#@~%+*-]+))/ig, '$1' ) ); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 1ea2686f..e9853f22 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -72,7 +72,7 @@ endif; ?> - + diff --git a/tpl/page.php b/tpl/page.php index 935a1721..f54170e1 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -50,7 +50,7 @@ endif; ?> - +