]> git.mxchange.org Git - friendica.git/blobdiff - include/Probe.php
regenerated master messages.po for new strings in the admin panel
[friendica.git] / include / Probe.php
index c31b98a9aa45aa3cda74fe54bda1f0ca75c50490..7cda542d0b45659545dc2bb19719ff7085b87af8 100644 (file)
@@ -200,7 +200,7 @@ class Probe {
        }
 
        /**
-        * @brief Fetch information about a given uri
+        * @brief Fetch information (protocol endpoints and user information) about a given uri
         *
         * @param string $uri Address that should be probed
         * @param string $network Test for this specific network
@@ -232,10 +232,15 @@ class Probe {
                else
                        $data["photo"] = App::get_baseurl().'/images/person-175.jpg';
 
-               if (!isset($data["name"]))
-                       $data["name"] = $data["url"];
+               if (!isset($data["name"]) OR ($data["name"] == "")) {
+                       if (isset($data["nick"]))
+                               $data["name"] = $data["nick"];
 
-               if (!isset($data["nick"])) {
+                       if ($data["name"] == "")
+                               $data["name"] = $data["url"];
+               }
+
+               if (!isset($data["nick"]) OR ($data["nick"] == "")) {
                        $data["nick"] = strtolower($data["name"]);
 
                        if (strpos($data['nick'], ' '))
@@ -274,7 +279,9 @@ class Probe {
        }
 
        /**
-        * @brief Detect information about a given uri
+        * @brief Fetch information (protocol endpoints and user information) about a given uri
+        *
+        * This function is only called by the "uri" function that adds caching and rearranging of data.
         *
         * @param string $uri Address that should be probed
         * @param string $network Test for this specific network
@@ -284,7 +291,7 @@ class Probe {
         */
        private function detect($uri, $network, $uid) {
                if (strstr($uri, '@')) {
-                       // If the URI starts with "mailto:" then jum directly to the mail detection
+                       // If the URI starts with "mailto:" then jump directly to the mail detection
                        if (strpos($url,'mailto:') !== false) {
                                $uri = str_replace('mailto:', '', $url);
                                return self::mail($uri, $uid);
@@ -401,7 +408,9 @@ class Probe {
        }
 
        /**
-        * @brief Do a webfinger request
+        * @brief Perform a webfinger request.
+        *
+        * For details see RFC 7033: <https://tools.ietf.org/html/rfc7033>
         *
         * @param string $url Address that should be probed
         *
@@ -453,7 +462,10 @@ class Probe {
        }
 
        /**
-        * @brief Poll the noscrape page (Friendica specific)
+        * @brief Poll the Friendica specific noscrape page.
+        *
+        * "noscrape" is a faster alternative to fetch the data from the hcard.
+        * This functionality was originally created for the directory.
         *
         * @param string $noscrape Link to the noscrape page
         * @param array $data The already fetched data
@@ -538,7 +550,7 @@ class Probe {
        }
 
        /**
-        * @brief Fetch data from a DFRN profile page
+        * @brief Fetch data from a DFRN profile page and via "noscrape"
         *
         * @param string $profile Link to the profile page
         *