revert regex to last state of @rugk that included bracket support

This commit is contained in:
El RIDO 2018-08-11 08:21:42 +02:00
parent 10201dc463
commit 7a26d5a823
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 4 additions and 3 deletions

View File

@ -139,6 +139,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
* http://user:example.com@localhost:8800/zero/?6f09182b8ea51997#WtLEUO5Epj9UHAV9JFs+6pUQZp13TuspAUjnF+iM+dM=
* </pre>
*
* @see {@link https://regex101.com/r/h4ACei/5}
* @name Helper.urls2links
* @function
* @param {string} html
@ -147,7 +148,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
me.urls2links = function(html)
{
return html.replace(
/(((https?|ftp):\/\/[\w?!=&.\/-;#@~%+*-]+(?![\w\s?!&.\/;#~%"=-]*>))|((magnet):[\w?=&.\/-;#@~%+*-]+))/ig,
/(((https?|ftp):\/\/(([a-z0-9$_\.\+!\*\'\(\),;\?&=-]|%[0-9a-f]{2})+(:([a-z0-9$_\.\+!\*\'\(\),;\?&=-]|%[0-9a-f]{2})+)?@)?((([a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*[a-z][a-z0-9-]*[a-z0-9]?|((\d|[1-9]\d|1\d{2}|2[0-4][0-9]|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4][0-9]|25[0-5]))(:\d+)?)(((\/+([a-z0-9$_\.\+!\*\'\(\),;:@&=-]|%[0-9a-f]{2})*)*(\?([a-z0-9$_\.\+!\*\'\(\),;:@&=-]|%[0-9a-f]{2})*)?)?)?(#([a-z0-9$_\.\+!\*\'\(\),;:@&=-]|%[0-9a-f]{2})*)?|((magnet):[\w?=&.\/-;#@~%+*-]+)))/ig,
'<a href="$1" rel="nofollow">$1</a>'
);
};

View File

@ -75,7 +75,7 @@ if ($MARKDOWN):
<?php
endif;
?>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-vh4evn4c6Xsa7wmSr6x1pS7VC8FSZCH35pa4ueRho6euazKdYX+dHcNbIMJxBlH9ohpbKJIgCO2teXHf8hdohg==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-+whRAkBPF/09Yxi3O3/BBUROB7zfe+HSEp31d7gUqXBs9dZ3r9KVHhVxYoNbHHwcLtycJVaseGxepX4G+xVaAw==" crossorigin="anonymous"></script>
<!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]-->

View File

@ -53,7 +53,7 @@ if ($MARKDOWN):
<?php
endif;
?>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-vh4evn4c6Xsa7wmSr6x1pS7VC8FSZCH35pa4ueRho6euazKdYX+dHcNbIMJxBlH9ohpbKJIgCO2teXHf8hdohg==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-+whRAkBPF/09Yxi3O3/BBUROB7zfe+HSEp31d7gUqXBs9dZ3r9KVHhVxYoNbHHwcLtycJVaseGxepX4G+xVaAw==" crossorigin="anonymous"></script>
<!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]-->