diff options
-rw-r--r-- | extlib/OAuth.php | 3 | ||||
-rw-r--r-- | lib/util.php | 6 | ||||
-rw-r--r-- | tests/URLDetectionTest.php | 16 |
3 files changed, 21 insertions, 4 deletions
diff --git a/extlib/OAuth.php b/extlib/OAuth.php index 029166175..fd4853554 100644 --- a/extlib/OAuth.php +++ b/extlib/OAuth.php @@ -199,7 +199,8 @@ class OAuthRequest {/*{{{*/ } else { // collect request parameters from query string (GET) and post-data (POST) if appropriate (note: POST vars have priority) $req_parameters = $_GET; - if ($http_method == "POST" && @strstr($request_headers["Content-Type"], "application/x-www-form-urlencoded") ) { + if ($http_method == "POST" && + ( @strstr($request_headers["Content-Type"], "application/x-www-form-urlencoded") || @strstr($_ENV["CONTENT_TYPE"], "application/x-www-form-urlencoded") )) { $req_parameters = array_merge($req_parameters, $_POST); } diff --git a/lib/util.php b/lib/util.php index f4ba3a6c2..79611af2c 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 9a103b6f7..c5d29e0f6 100644 --- a/tests/URLDetectionTest.php +++ b/tests/URLDetectionTest.php @@ -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/"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', '<a href="http://127.0.0.1/test%20stuff" rel="external">127.0.0.1/test%20stuff</a>'), array('http://[::1]:99/test.php', |