From 5974871b7b00bd8e3f28dc5f5a9465a9eec0d3d3 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 3 Sep 2009 18:34:30 -0400 Subject: [PATCH 1/2] Improve OAuth CGI compatibility Fixes http://status.net/trac/ticket/1822 Reported upstream at http://code.google.com/p/oauth/issues/detail?id=118 --- extlib/OAuth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extlib/OAuth.php b/extlib/OAuth.php index 029166175c..fd48535545 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); } From 80b7e54ca2cebcfd7c2c5e63b4ef604106a42aca Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 4 Sep 2009 11:30:29 -0400 Subject: [PATCH 2/2] Added additional characters as allowed in URLs. --- lib/util.php | 6 +++--- tests/URLDetectionTest.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/util.php b/lib/util.php index f4ba3a6c21..79611af2c4 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 ')(?127.0.0.1/Name:test.php'), array('127.0.0.1/~test', '127.0.0.1/~test'), + array('127.0.0.1/+test', + '127.0.0.1/+test'), + array('127.0.0.1/$test', + '127.0.0.1/$test'), + array('127.0.0.1/\'test', + '127.0.0.1/\'test'), + array('127.0.0.1/"test', + '127.0.0.1/"test'), + array('127.0.0.1/-test', + '127.0.0.1/-test'), + array('127.0.0.1/_test', + '127.0.0.1/_test'), + array('127.0.0.1/!test', + '127.0.0.1/!test'), + array('127.0.0.1/*test', + '127.0.0.1/*test'), array('127.0.0.1/test%20stuff', '127.0.0.1/test%20stuff'), array('http://[::1]:99/test.php',