diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py index f36c5612..5cd65c80 100644 --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -960,8 +960,8 @@ tags_paterns = OrderedDict(( ('see', (re.compile(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'), '
')), - ('url', (re.compile(r'\[url\ \=\>\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((.*?)\)\]'), - '')), + ('url', (re.compile(r'\[url\ \=\>\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((http://|https://|/)(.*?)\)\]'), + '')), ('license', (re.compile(r'\[license\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'), '')), diff --git a/rhodecode/tests/lib/test_libs.py b/rhodecode/tests/lib/test_libs.py index 1bb22732..f72f9690 100644 --- a/rhodecode/tests/lib/test_libs.py +++ b/rhodecode/tests/lib/test_libs.py @@ -237,6 +237,19 @@ def test_age_in_future(age_args, expected, kw, pylonsapp): ('url', '[url => [name](http://rc.com)]'), ]), # 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]"