Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed response code handling

  • Loading branch information...
commit 2bce49e177ae319af55e325ed008e45e344e28f5 1 parent bb13423
@dustinwhittle dustinwhittle authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/Yahoo.inc
View
7 lib/Yahoo.inc
@@ -1524,7 +1524,7 @@ class NativeSessionStore {
* @return The request token.
*/
function fetchRequestToken() {
- return json_decode($_SESSION["yosdk_rt"]);
+ return isset($_SESSION["yosdk_rt"]) ? json_decode($_SESSION["yosdk_rt"]) : false;
}
/**
@@ -1550,7 +1550,7 @@ class NativeSessionStore {
* @return The access token.
*/
function fetchAccessToken() {
- return json_decode($_SESSION["yosdk_at"]);
+ return isset($_SESSION["yosdk_at"]) ? json_decode($_SESSION["yosdk_at"]) : false;
}
/**
@@ -1792,7 +1792,8 @@ class OAuthClient {
'responseHeaders' => $headerParser->headers,
'responseBody' => $response
);
- if($response["code"] >= 200 && $response["code"] < 300) {
+
+ if($response["code"] <= 200 && $response["code"] > 300) {
YahooLogger::error("HTTP request failed", $response);
$this->checkExpired($response["code"], $headerParser);
Please sign in to comment.
Something went wrong with that request. Please try again.