Allow @ signs in the path, querystring, and fragment parts of URLs
This commit is contained in:
parent
2a56245614
commit
292bb7c4d8
|
@ -442,9 +442,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
|
|||
')'.
|
||||
'(?:'.
|
||||
'(?:\:\d+)?'. //:port
|
||||
'(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"]*)?'. // /path
|
||||
'(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/]*)?'. // ?query string
|
||||
'(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\/\?\#]*)?'. // #fragment
|
||||
'(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"@]*)?'. // /path
|
||||
'(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"@\/]*)?'. // ?query string
|
||||
'(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\"\@/\?\#]*)?'. // #fragment
|
||||
')(?<![\?\.\,\#\,])'.
|
||||
')'.
|
||||
'#ixu';
|
||||
|
|
|
@ -27,6 +27,8 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
|
|||
return array(
|
||||
array('not a link :: no way',
|
||||
'not a link :: no way'),
|
||||
array('link http://www.somesite.com/xyz/35637563@N00/52803365/ link',
|
||||
'link <a href="http://www.somesite.com/xyz/35637563@N00/52803365/" rel="external">http://www.somesite.com/xyz/35637563@N00/52803365/</a> link'),
|
||||
array('http://127.0.0.1',
|
||||
'<a href="http://127.0.0.1/" rel="external">http://127.0.0.1</a>'),
|
||||
array('127.0.0.1',
|
||||
|
|
Loading…
Reference in New Issue
Block a user