diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -947,8 +947,8 @@ tags_paterns = OrderedDict(( ('see', (re.compile(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'), '
see: \\1
')), - ('url', (re.compile(r'\[url\ \=\>\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((.*?)\)\]'), - '
\\1
')), + ('url', (re.compile(r'\[url\ \=\>\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((http://|https://|/)(.*?)\)\]'), + '
\\1
')), ('license', (re.compile(r'\[license\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'), '
\\1
')), diff --git a/rhodecode/tests/lib/test_libs.py b/rhodecode/tests/lib/test_libs.py --- a/rhodecode/tests/lib/test_libs.py +++ b/rhodecode/tests/lib/test_libs.py @@ -238,6 +238,19 @@ def test_age_in_future(age_args, expecte ]), # entry (( + "[url => [linkNameJS](javascript:alert(document.domain))]\n" + "[url => [linkNameHTTP](http://rhodecode.com)]\n" + "[url => [linkNameHTTPS](https://rhodecode.com)]\n" + "[url => [linkNamePath](/repo_group)]\n" + ), + [ + ('generic', '[linkNameJS]'), + ('url', '[url => [linkNameHTTP](http://rhodecode.com)]'), + ('url', '[url => [linkNameHTTPS](https://rhodecode.com)]'), + ('url', '[url => [linkNamePath](/repo_group)]'), + ]), + # entry + (( "hello pta[tag] gog [[]] [[] sda ero[or]d [me =>>< sa]" "[requires] [stale] [see<>=>] [see => http://url.com]" "[requires => url] [lang => python] [just a tag] "