summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-08-31 17:53:54 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-08-31 17:53:54 +0000
commit33d2ae6af3a97ddcd60692e4b12603077b140c23 (patch)
treeb9f24fc9d340d4990a9766900082447a9687d4b4
parent9f372da3da4bd445175eda9155fa7fdd13d3c85e (diff)
parent20423af689fbf4dd139e1254dc49ae3df1db0de2 (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
-rw-r--r--lib/util.php6
-rw-r--r--tests/URLDetectionTest.php4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php
index 7228b3fe3..6e79ffda4 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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';
diff --git a/tests/URLDetectionTest.php b/tests/URLDetectionTest.php
index fd697c218..9a103b6f7 100644
--- a/tests/URLDetectionTest.php
+++ b/tests/URLDetectionTest.php
@@ -31,8 +31,8 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
'<a href="http://127.0.0.1/" rel="external">127.0.0.1</a>'),
array('127.0.0.1:99',
'<a href="http://127.0.0.1:99/" rel="external">127.0.0.1:99</a>'),
- array('127.0.0.1/test.php',
- '<a href="http://127.0.0.1/test.php" rel="external">127.0.0.1/test.php</a>'),
+ array('127.0.0.1/Name:test.php',
+ '<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',
'<a href="http://127.0.0.1/~test" rel="external">127.0.0.1/~test</a>'),
array('127.0.0.1/test%20stuff',