Fix errors in statusnet addon
parent
b99ac65c0b
commit
cfb6b3123f
|
@ -116,7 +116,7 @@ class CodebirdSN
|
||||||
* Returns singleton class instance
|
* Returns singleton class instance
|
||||||
* Always use this method unless you're working with multiple authenticated users at once
|
* Always use this method unless you're working with multiple authenticated users at once
|
||||||
*
|
*
|
||||||
* @return Codebird The instance
|
* @return CodebirdSN The instance
|
||||||
*/
|
*/
|
||||||
public static function getInstance()
|
public static function getInstance()
|
||||||
{
|
{
|
||||||
|
@ -420,6 +420,7 @@ class CodebirdSN
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CODEBIRD_RETURNFORMAT_OBJECT:
|
case CODEBIRD_RETURNFORMAT_OBJECT:
|
||||||
|
/** @var object $reply */
|
||||||
$reply->httpstatus = $httpstatus;
|
$reply->httpstatus = $httpstatus;
|
||||||
if ($httpstatus == 200) {
|
if ($httpstatus == 200) {
|
||||||
self::setBearerToken($reply->access_token);
|
self::setBearerToken($reply->access_token);
|
||||||
|
@ -490,7 +491,7 @@ class CodebirdSN
|
||||||
/**
|
/**
|
||||||
* Generates a (hopefully) unique random string
|
* Generates a (hopefully) unique random string
|
||||||
*
|
*
|
||||||
* @param int optional $length The length of the string to generate
|
* @param int $length The optional length of the string to generate
|
||||||
*
|
*
|
||||||
* @return string The random string
|
* @return string The random string
|
||||||
*/
|
*/
|
||||||
|
@ -507,7 +508,7 @@ class CodebirdSN
|
||||||
*
|
*
|
||||||
* @param string $httpmethod Usually either 'GET' or 'POST' or 'DELETE'
|
* @param string $httpmethod Usually either 'GET' or 'POST' or 'DELETE'
|
||||||
* @param string $method The API method to call
|
* @param string $method The API method to call
|
||||||
* @param array optional $params The API call parameters, associative
|
* @param array $params optional The API call parameters, associative
|
||||||
*
|
*
|
||||||
* @return string Authorization HTTP header
|
* @return string Authorization HTTP header
|
||||||
*/
|
*/
|
||||||
|
@ -874,9 +875,9 @@ class CodebirdSN
|
||||||
* @param string $httpmethod The HTTP method to use for making the request
|
* @param string $httpmethod The HTTP method to use for making the request
|
||||||
* @param string $method The API method to call
|
* @param string $method The API method to call
|
||||||
* @param string $method_template The templated API method to call
|
* @param string $method_template The templated API method to call
|
||||||
* @param array optional $params The parameters to send along
|
* @param array $params optional The parameters to send along
|
||||||
* @param bool optional $multipart Whether to use multipart/form-data
|
* @param bool $multipart optional Whether to use multipart/form-data
|
||||||
* @param bool optional $app_only_auth Whether to use app-only bearer authentication
|
* @param bool $app_only_auth optional Whether to use app-only bearer authentication
|
||||||
*
|
*
|
||||||
* @return mixed The API reply, encoded in the set return_format
|
* @return mixed The API reply, encoded in the set return_format
|
||||||
*/
|
*/
|
||||||
|
@ -959,6 +960,7 @@ class CodebirdSN
|
||||||
$httpstatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$httpstatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
$reply = $this->_parseApiReply($method_template, $reply);
|
$reply = $this->_parseApiReply($method_template, $reply);
|
||||||
if ($this->_return_format == CODEBIRD_RETURNFORMAT_OBJECT) {
|
if ($this->_return_format == CODEBIRD_RETURNFORMAT_OBJECT) {
|
||||||
|
/** @var object $reply */
|
||||||
$reply->httpstatus = $httpstatus;
|
$reply->httpstatus = $httpstatus;
|
||||||
} elseif ($this->_return_format == CODEBIRD_RETURNFORMAT_ARRAY) {
|
} elseif ($this->_return_format == CODEBIRD_RETURNFORMAT_ARRAY) {
|
||||||
$reply['httpstatus'] = $httpstatus;
|
$reply['httpstatus'] = $httpstatus;
|
||||||
|
|
|
@ -52,11 +52,6 @@ class StatusNetOAuth extends TwitterOAuth
|
||||||
*
|
*
|
||||||
* Copied here from the TwitterOAuth library and complemented by applying the proxy settings of Friendica
|
* Copied here from the TwitterOAuth library and complemented by applying the proxy settings of Friendica
|
||||||
*
|
*
|
||||||
* @param string $method
|
|
||||||
* @param string $host
|
|
||||||
* @param string $path
|
|
||||||
* @param array $parameters
|
|
||||||
*
|
|
||||||
* @return array|object API results
|
* @return array|object API results
|
||||||
*/
|
*/
|
||||||
function http($url, $method, $postfields = NULL)
|
function http($url, $method, $postfields = NULL)
|
||||||
|
|
|
@ -93,7 +93,7 @@ class TwitterOAuth
|
||||||
/**
|
/**
|
||||||
* Get a request_token
|
* Get a request_token
|
||||||
*
|
*
|
||||||
* @param callback $oauth_callback
|
* @param callable $oauth_callback
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getRequestToken($oauth_callback = null)
|
function getRequestToken($oauth_callback = null)
|
||||||
|
@ -112,8 +112,6 @@ class TwitterOAuth
|
||||||
/**
|
/**
|
||||||
* Get the authorize URL
|
* Get the authorize URL
|
||||||
*
|
*
|
||||||
* @param array $token
|
|
||||||
* @param bool $sign_in_with_tumblr
|
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getAuthorizeURL($token, $sign_in_with_twitter = TRUE)
|
function getAuthorizeURL($token, $sign_in_with_twitter = TRUE)
|
||||||
|
|
Loading…
Reference in New Issue