Skip to content

Commit

Permalink
Safety
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Apr 12, 2011
1 parent 51253f0 commit 9c3bda4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion calculate.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ public static function facebook($url, $modifier = 1)
return self::prepare_return(0, $modifier);
}

$item_data = json_decode($json);
$item_data = json_decode($json);
if (!is_array($item_data))
{
return self::prepare_return(0, $modifier);
}
if ( !isset($item_data[0])
|| !isset($item_data[0]->total_count))
{
Expand Down

0 comments on commit 9c3bda4

Please sign in to comment.