]> git.mxchange.org Git - friendica.git/commitdiff
Corrected the output
authorMichael Vogel <icarus@dabo.de>
Mon, 10 Aug 2015 19:54:57 +0000 (21:54 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 10 Aug 2015 19:54:57 +0000 (21:54 +0200)
mod/_well_known.php
mod/nodeinfo.php

index 1271e12f49ce0a7636b9f0e1b6877ef0d8473b8e..33070a1ecdf4dc071d65aabd94b67f530be47efe 100644 (file)
@@ -61,6 +61,6 @@ function wk_social_relay(&$a) {
                        "tags" => $taglist);\r
 \r
        header('Content-type: application/json; charset=utf-8');\r
-       echo json_encode($relay, true);\r
+       echo json_encode($relay, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);\r
        exit;\r
 }\r
index bf1d4ef3ef20d1e9709897a2fad51ee36c82ec3e..065f33eb19bc983423739a24e7e88f5fb107018f 100644 (file)
@@ -12,7 +12,7 @@ function nodeinfo_wellknown(&$a) {
                                        "href" => $a->get_baseurl()."/nodeinfo/1.0"));
 
        header('Content-type: application/json; charset=utf-8');
-       echo json_encode($nodeinfo, true);
+       echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
        exit;
 }
 
@@ -72,7 +72,7 @@ function nodeinfo_init(&$a){
        if (nodeinfo_plugin_enabled("fbpost") OR nodeinfo_plugin_enabled("buffer"))
                $nodeinfo["services"][] = "facebook";
 
-       $nodeinfo["services"][] = " friendica";
+       $nodeinfo["services"][] = "friendica";
 
        if (nodeinfo_plugin_enabled("statusnet") OR !get_config("system","ostatus_disabled"))
                $nodeinfo["services"][] = "gnusocial";
@@ -107,14 +107,16 @@ function nodeinfo_init(&$a){
        $nodeinfo["openRegistrations"] = ($a->config['register_policy'] != 0);
 
        $nodeinfo["usage"] = array();
-       $nodeinfo["usage"]["users"] = array("total" => get_config("nodeinfo","total_users"),
-                               "activeHalfyear" => get_config("nodeinfo","active_users_halfyear"),
-                               "activeMonth" => get_config("nodeinfo","active_users_monthly"));
-       $nodeinfo["usage"]["localPosts"] = get_config("nodeinfo","local_posts");
-       $nodeinfo["usage"]["localComments"] = get_config("nodeinfo","local_comments");
+       $nodeinfo["usage"]["users"] = array("total" => (int)get_config("nodeinfo","total_users"),
+                               "activeHalfyear" => (int)get_config("nodeinfo","active_users_halfyear"),
+                               "activeMonth" => (int)get_config("nodeinfo","active_users_monthly"));
+       $nodeinfo["usage"]["localPosts"] = (int)get_config("nodeinfo","local_posts");
+       $nodeinfo["usage"]["localComments"] = (int)get_config("nodeinfo","local_comments");
+
+       $nodeinfo["usage"]["metadata"] = array();
 
        header('Content-type: application/json; charset=utf-8');
-       echo json_encode($nodeinfo, true);
+       echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
        exit;
 }