diff options
author | Sarven Capadisli <csarven@status.net> | 2009-11-02 17:57:43 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-11-02 17:57:43 +0000 |
commit | 8b7bce12f8d2ca5efdd744bcb09dcf1f8e5f645a (patch) | |
tree | 8bf14bc5300d08a12bf3b2f53349a010531c2451 | |
parent | 1b00cdf12413d1b6b92edf6aa377448edb516a12 (diff) | |
parent | 87484424a5f4f90c5bbf81474f2cc4ceee313c32 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
-rw-r--r-- | lib/util.php | 6 | ||||
-rw-r--r-- | tests/URLDetectionTest.php | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php index d159c583e..31a78a876 100644 --- a/lib/util.php +++ b/lib/util.php @@ -452,9 +452,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'; diff --git a/tests/URLDetectionTest.php b/tests/URLDetectionTest.php index 0cc03ccce..d83f9faf5 100644 --- a/tests/URLDetectionTest.php +++ b/tests/URLDetectionTest.php @@ -185,12 +185,12 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase array('http://example.com/path/(foo)/bar', '<a href="http://example.com/path/(foo)/bar" title="http://example.com/path/(foo)/bar" rel="external">http://example.com/path/(foo)/bar</a>'), array('http://example.com/path/[foo]/bar', - '<a href="http://example.com/path/[foo]/bar" title="http://example.com/path/[foo]/bar" rel="external">http://example.com/path/[foo]/bar</a>'), + '<a href="http://example.com/path/" title="http://example.com/path/" rel="external">http://example.com/path/</a>[foo]/bar'), array('http://example.com/path/foo/(bar)', '<a href="http://example.com/path/foo/(bar)" title="http://example.com/path/foo/(bar)" rel="external">http://example.com/path/foo/(bar)</a>'), //Not a valid url - urls cannot contain unencoded square brackets array('http://example.com/path/foo/[bar]', - '<a href="http://example.com/path/foo/[bar]" title="http://example.com/path/foo/[bar]" rel="external">http://example.com/path/foo/[bar]</a>'), + '<a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="external">http://example.com/path/foo/</a>[bar]'), array('Hey, check out my cool site http://example.com okay?', 'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="external">http://example.com</a> okay?'), array('What about parens (e.g. http://example.com/path/foo/(bar))?', |