]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added additional characters as allowed in URLs.
authorCraig Andrews <candrews@integralblue.com>
Fri, 4 Sep 2009 15:30:29 +0000 (11:30 -0400)
committerCraig Andrews <candrews@integralblue.com>
Fri, 4 Sep 2009 15:30:29 +0000 (11:30 -0400)
lib/util.php
tests/URLDetectionTest.php

index f4ba3a6c21d0a23a833e1486826ae5039c828136..79611af2c4b88d04b2a8c93a3fca8432707a6e38 100644 (file)
@@ -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';
index 9a103b6f7cbcc9a98035563ffd94e16e907c6b39..c5d29e0f61ea2474943555c6026471208b36ea50 100644 (file)
@@ -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>'),
                      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/&quot;test" rel="external">127.0.0.1/&quot;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',
                            '<a href="http://127.0.0.1/test%20stuff" rel="external">127.0.0.1/test%20stuff</a>'),
                      array('http://[::1]:99/test.php',