Skip to content

Commit

Permalink
Use modX.fromJSON() instead of json_decode
Browse files Browse the repository at this point in the history
Not all server environments may have json_decode, the modX.fromJSON() method contains a polyfill if it doesn't exist.
  • Loading branch information
Mark-H committed Apr 15, 2012
1 parent 85410c9 commit a44e07b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fblikes.snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// get page information from facebooks graph api (returns json data)
$graphdata = file_get_contents("http://graph.facebook.com/".$pageid);
// decode json response
$response = json_decode($graphdata, true);
$response = $modx->fromJSON($graphdata);
// get like number
$data = $response['likes'];

Expand Down

0 comments on commit a44e07b

Please sign in to comment.