diff --git a/lib/oauthlib.php b/lib/oauthlib.php index bc198b936bf..7f5ea64fe08 100644 --- a/lib/oauthlib.php +++ b/lib/oauthlib.php @@ -286,7 +286,11 @@ class oauth_helper { } // to access protected resource, sign_secret will alwasy be consumer_secret+token_secret $this->sign_secret = $this->consumer_secret.'&'.$secret; - $oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token), $method); + if (strtolower($method) === 'post' && !empty($params)) { + $oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token) + $params, $method); + } else { + $oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token), $method); + } $this->setup_oauth_http_header($oauth_params); $content = call_user_func_array(array($this->http, strtolower($method)), array($url, $params, $this->http_options)); // reset http header and options to prepare for the next request