@@ -58,7 +58,7 @@ class Codebird
58
58
/**
59
59
* The API endpoint to use
60
60
*/
61
- private $ _endpoint = 'https://api.twitter.com/1/ ' ;
61
+ private $ _endpoint = 'https://api.twitter.com/1.1 / ' ;
62
62
63
63
/**
64
64
* The API endpoint to use for OAuth requests
@@ -69,7 +69,7 @@ class Codebird
69
69
* The API endpoint to use for uploading tweets with media
70
70
* see https://dev.twitter.com/discussions/1059
71
71
*/
72
- private $ _endpoint_upload = 'https://upload.twitter.com/1/ ' ;
72
+ private $ _endpoint_upload = 'https://upload.twitter.com/1.1 / ' ;
73
73
74
74
/**
75
75
* The Request or access token. Used to sign requests
@@ -99,7 +99,7 @@ class Codebird
99
99
/**
100
100
* The current Codebird version
101
101
*/
102
- private $ _version = '2.2.0 ' ;
102
+ private $ _version = '2.2.1 ' ;
103
103
104
104
/**
105
105
* Returns singleton class instance
@@ -235,13 +235,12 @@ public function __call($fn, $params)
235
235
}
236
236
237
237
$ httpmethod = $ this ->_detectMethod ($ method_template );
238
- $ sign = $ this ->_detectSign ($ method_template );
239
238
$ multipart = $ this ->_detectMultipart ($ method_template );
240
239
241
240
// geek-geek: Now allowing to specify filenames as params
242
241
$ this ->_detectFilenames ($ method_template , $ apiparams );
243
242
244
- return $ this ->_callApi ($ httpmethod , $ method , $ method_template , $ apiparams , $ sign , $ multipart );
243
+ return $ this ->_callApi ($ httpmethod , $ method , $ method_template , $ apiparams , $ multipart );
245
244
}
246
245
247
246
/**
@@ -584,22 +583,6 @@ private function _detectMethod($method)
584
583
throw new Exception ('Can \'t find HTTP method to use for " ' . $ method . '". ' );
585
584
}
586
585
587
- /**
588
- * Detects if API call should be signed
589
- *
590
- * @param string $method The API method to call
591
- *
592
- * @return bool Whether the API call should be signed
593
- */
594
- private function _detectSign ($ method )
595
- {
596
- $ unsignedmethods = array (
597
- // OAuth
598
- 'oauth/request_token '
599
- );
600
- return !in_array ($ method , $ unsignedmethods );
601
- }
602
-
603
586
/**
604
587
* Detects if API call should use multipart/form-data
605
588
*
@@ -716,15 +699,14 @@ private function _getEndpoint($method)
716
699
* @param string $method The API method to call
717
700
* @param string $method_template The templated API method to call
718
701
* @param array optional $params The parameters to send along
719
- * @param bool optional $sign Whether to sign the API call
720
702
* @param bool optional $multipart Whether to use multipart/form-data
721
703
*
722
704
* @return mixed The API reply, encoded in the set return_format
723
705
*/
724
706
725
- private function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ sign = true , $ multipart = false )
707
+ private function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false )
726
708
{
727
- if ($ sign && !isset ($ this ->_oauth_token )) {
709
+ if (!isset ($ this ->_oauth_token )) {
728
710
throw new Exception ('To make a signed API request, the OAuth token must be set. ' );
729
711
}
730
712
if (! function_exists ('curl_init ' )) {
0 commit comments