CSteipp has uploaded a new change for review.
https://gerrit.wikimedia.org/r/79154
Change subject: Fixes for getting signed post variables
......................................................................
Fixes for getting signed post variables
Stay with the spec and only use application/x-www-form-urlencoded POST
requests.
Change-Id: Idc7578096bec94fd5ca39fd4fe69a8a7c90ea2b2
---
M backend/MWOAuthRequest.php
M lib/OAuth.php
2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth
refs/changes/54/79154/1
diff --git a/backend/MWOAuthRequest.php b/backend/MWOAuthRequest.php
index f5fa6be..0321abd 100644
--- a/backend/MWOAuthRequest.php
+++ b/backend/MWOAuthRequest.php
@@ -50,7 +50,8 @@
'application/x-www-form-urlencoded'
) === 0
) {
- $postData = $request->getPostValues();
+ $postData = OAuthUtil::parse_parameters(
$request->getRawPostString() );
+wfDebugLog( 'OAuth', __METHOD__ . ": Post String = $postData" );
$parameters = array_merge( $parameters, $postData );
}
diff --git a/lib/OAuth.php b/lib/OAuth.php
index 1352e5d..1a3b5bc 100644
--- a/lib/OAuth.php
+++ b/lib/OAuth.php
@@ -860,7 +860,7 @@
return $out;
}
- // This function takes a input like a = b&a = c&d = e and returns the
parsed
+ // This function takes a input like a=b&a=c&d=e and returns the parsed
// parameters like this
// array( 'a' => array( 'b','c' ), 'd' => 'e' )
public static function parse_parameters( $input ) {
@@ -870,7 +870,7 @@
$parsed_parameters = array();
foreach ( $pairs as $pair ) {
- $split = explode( ' = ', $pair, 2 );
+ $split = explode( '=', $pair, 2 );
$parameter = OAuthUtil::urldecode_rfc3986( $split[0] );
$value = isset( $split[1] ) ?
OAuthUtil::urldecode_rfc3986( $split[1] ) : '';
--
To view, visit https://gerrit.wikimedia.org/r/79154
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc7578096bec94fd5ca39fd4fe69a8a7c90ea2b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits