Twitter responds with json but oauth exception thinks its a string and doesn't parse it
BugTriage
<!-- DO NOT INCLUDE CONSUMER_SECRET OR ACCESS_TOKEN_SECRET -->
In twitterOauth.php if there is an exception in the call to this:
$result = $this->oAuthRequest($url, 'POST', $parameters);
returns JSON instead of a simple string as shown here
{"errors":[{"code":415,"message":"Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings"}]}
So the code then throws an exception with $result as the exception message instead of parsing the json.
so that e->message is
"errors":[{"code":415,"message":"Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings"}]
The added double quotes inside the message causes problems when outputing what is assumed to be a string
**Expected behavior**
On exception e->message should be a simple string, not json
**Actual behavior**
e->message is json
**Versions:**
- TwitterOAuth: [e.g. v4.0.1]
- PHP: v [e.g. v7.4.33]
0 条评论