]> git.mxchange.org Git - friendica.git/blobdiff - mod/_well_known.php
Fix Scrutinizer issues in mod [_well_know -> contactgroup]
[friendica.git] / mod / _well_known.php
index d75f43fbe0fc76bfb7859c5e1bb9696b1bf66430..5d1c1f4311fe1a124d836cd17e45e1428bfee3e8 100644 (file)
@@ -7,14 +7,15 @@ require_once("mod/hostxrd.php");
 require_once("mod/nodeinfo.php");
 require_once("mod/xrd.php");
 
-function _well_known_init(App $a) {
+function _well_known_init(App $a)
+{
        if ($a->argc > 1) {
-               switch($a->argv[1]) {
+               switch ($a->argv[1]) {
                        case "host-meta":
                                hostxrd_init($a);
                                break;
                        case "x-social-relay":
-                               wk_social_relay($a);
+                               wk_social_relay();
                                break;
                        case "nodeinfo":
                                nodeinfo_wellknown($a);
@@ -28,9 +29,9 @@ function _well_known_init(App $a) {
        killme();
 }
 
-function wk_social_relay(App $a) {
-
-       $subscribe = (bool)Config::get('system', 'relay_subscribe', false);
+function wk_social_relay()
+{
+       $subscribe = (bool) Config::get('system', 'relay_subscribe', false);
 
        if ($subscribe) {
                $scope = Config::get('system', 'relay_scope', SR_SCOPE_ALL);
@@ -44,14 +45,14 @@ function wk_social_relay(App $a) {
                $server_tags = Config::get('system', 'relay_server_tags');
                $tagitems = explode(",", $server_tags);
 
-               foreach($tagitems AS $tag) {
+               foreach ($tagitems AS $tag) {
                        $tags[trim($tag, "# ")] = trim($tag, "# ");
                }
 
                if (Config::get('system', 'relay_user_tags')) {
                        $terms = q("SELECT DISTINCT(`term`) FROM `search`");
 
-                       foreach($terms AS $term) {
+                       foreach ($terms AS $term) {
                                $tag = trim($term["term"], "#");
                                $tags[$tag] = $tag;
                        }
@@ -59,15 +60,17 @@ function wk_social_relay(App $a) {
        }
 
        $taglist = array();
-       foreach($tags AS $tag) {
+       foreach ($tags AS $tag) {
                $taglist[] = $tag;
        }
 
-       $relay = array("subscribe" => $subscribe,
-                       "scope" => $scope,
-                       "tags" => $taglist);
+       $relay = array(
+               "subscribe" => $subscribe,
+               "scope" => $scope,
+               "tags" => $taglist
+       );
 
        header('Content-type: application/json; charset=utf-8');
-       echo json_encode($relay, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
+       echo json_encode($relay, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
        exit;
 }