forked from GNUsocial/gnu-social
Added additional characters as allowed in URLs.
This commit is contained in:
parent
5974871b7b
commit
80b7e54ca2
@ -442,9 +442,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
|
|||||||
')'.
|
')'.
|
||||||
'(?:'.
|
'(?:'.
|
||||||
'(?:\:\d+)?'. //:port
|
'(?:\:\d+)?'. //:port
|
||||||
'(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~]*)?'. // /path
|
'(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"]*)?'. // /path
|
||||||
'(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\/]*)?'. // ?query string
|
'(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/]*)?'. // ?query string
|
||||||
'(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\/\?\#]*)?'. // #fragment
|
'(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/\?\#]*)?'. // #fragment
|
||||||
')(?<![\?\.\,\#\,])'.
|
')(?<![\?\.\,\#\,])'.
|
||||||
')'.
|
')'.
|
||||||
'#ixu';
|
'#ixu';
|
||||||
|
@ -35,6 +35,22 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
|
|||||||
'<a href="http://127.0.0.1/Name:test.php" rel="external">127.0.0.1/Name:test.php</a>'),
|
'<a href="http://127.0.0.1/Name:test.php" rel="external">127.0.0.1/Name:test.php</a>'),
|
||||||
array('127.0.0.1/~test',
|
array('127.0.0.1/~test',
|
||||||
'<a href="http://127.0.0.1/~test" rel="external">127.0.0.1/~test</a>'),
|
'<a href="http://127.0.0.1/~test" rel="external">127.0.0.1/~test</a>'),
|
||||||
|
array('127.0.0.1/+test',
|
||||||
|
'<a href="http://127.0.0.1/+test" rel="external">127.0.0.1/+test</a>'),
|
||||||
|
array('127.0.0.1/$test',
|
||||||
|
'<a href="http://127.0.0.1/$test" rel="external">127.0.0.1/$test</a>'),
|
||||||
|
array('127.0.0.1/\'test',
|
||||||
|
'<a href="http://127.0.0.1/\'test" rel="external">127.0.0.1/\'test</a>'),
|
||||||
|
array('127.0.0.1/"test',
|
||||||
|
'<a href="http://127.0.0.1/"test" rel="external">127.0.0.1/"test</a>'),
|
||||||
|
array('127.0.0.1/-test',
|
||||||
|
'<a href="http://127.0.0.1/-test" rel="external">127.0.0.1/-test</a>'),
|
||||||
|
array('127.0.0.1/_test',
|
||||||
|
'<a href="http://127.0.0.1/_test" rel="external">127.0.0.1/_test</a>'),
|
||||||
|
array('127.0.0.1/!test',
|
||||||
|
'<a href="http://127.0.0.1/!test" rel="external">127.0.0.1/!test</a>'),
|
||||||
|
array('127.0.0.1/*test',
|
||||||
|
'<a href="http://127.0.0.1/*test" rel="external">127.0.0.1/*test</a>'),
|
||||||
array('127.0.0.1/test%20stuff',
|
array('127.0.0.1/test%20stuff',
|
||||||
'<a href="http://127.0.0.1/test%20stuff" rel="external">127.0.0.1/test%20stuff</a>'),
|
'<a href="http://127.0.0.1/test%20stuff" rel="external">127.0.0.1/test%20stuff</a>'),
|
||||||
array('http://[::1]:99/test.php',
|
array('http://[::1]:99/test.php',
|
||||||
|
Loading…
Reference in New Issue
Block a user