Permalink
Browse files

Avoid Trying to get property of non-object PHP Notice during Bitly crawl

  • Loading branch information...
ginatrapani committed Feb 29, 2012
1 parent 659e1f2 commit 18d016e0ef9489a82df63718664c61cb57260390
Showing with 4 additions and 2 deletions.
  1. +4 −2 webapp/plugins/expandurls/model/class.BitlyAPIAccessor.php
@@ -75,15 +75,17 @@ public function getBitlyLinkData($u) {
$title = $bit_link['data']['info'][0]['title'];
}
} else {
- $error = (isset($bit_link->status_txt))?$bit_link->status_txt:'No response from http://bit.ly API';
+ $error = (isset($bit_link["status_txt"]))?$bit_link["status_txt"]:
+ 'No response from http://bit.ly API';
}
//Get expanded link
$bit_link = $this->apiRequest('expand?', $encoded_params);
if (isset($bit_link['status_code']) && $bit_link['status_code'] == '200'){
if (isset($bit_link['data']['expand'][0]['long_url'])) {
$expanded_url = $bit_link['data']['expand'][0]['long_url'];
} else {
- $error = (isset($bit_link->status_txt))?$bit_link->status_txt:'No response from http://bit.ly API';
+ $error = (isset($bit_link["status_txt?"]))?$bit_link["status_txt"]:
+ 'No response from http://bit.ly API';
}
}
//Get link clicks

0 comments on commit 18d016e

Please sign in to comment.