]> git.mxchange.org Git - friendica.git/commitdiff
add jsonp support to api
authorFabrixxm <fabrix.xm@gmail.com>
Thu, 16 Oct 2014 08:51:36 +0000 (10:51 +0200)
committerFabrixxm <fabrix.xm@gmail.com>
Thu, 16 Oct 2014 08:51:36 +0000 (10:51 +0200)
include/api.php

index f6096f29074eb1107f8edf0ef21bd74f5e288267..db55c05fed3d8110801498cdffd4833070e5a141 100644 (file)
                                        case "json":
                                                header ("Content-Type: application/json");
                                                foreach($r as $rr)
-                                                       return json_encode($rr);
+                                                       $json = json_encode($rr);
+                                                       if ($_GET['callback'])
+                                                               $json = $_GET['callback']."(".$json.")";
+                                                       return $json;                                                   
                                                break;
                                        case "rss":
                                                header ("Content-Type: application/rss+xml");