]> git.mxchange.org Git - friendica.git/commitdiff
Start a gcontact probing for new gcontacts
authorMichael Vogel <icarus@dabo.de>
Wed, 20 Apr 2016 19:47:57 +0000 (21:47 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 1 May 2016 11:48:52 +0000 (13:48 +0200)
include/socgraph.php
index.php

index b7d6f29344644ec5d30f792639e40ddd1cb839af..c1648fbbfa5ea4bb2960ff31e7deea6deb05c058 100644 (file)
@@ -1448,8 +1448,15 @@ function get_gcontact_id($contact) {
                $r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' ORDER BY `id` LIMIT 2",
                        dbesc(normalise_link($contact["url"])));
 
-               if ($r)
+               if ($r) {
                        $gcontact_id = $r[0]["id"];
+
+                       // Complete newly added contacts from "probable" accounts
+                       if (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_FEED))) {
+                               logger("Probing ".$contact["url"], LOGGER_DEBUG);
+                               proc_run('php', 'include/gprobe.php', bin2hex($contact["url"]));
+                       }
+               }
        }
 
        if ((count($r) > 1) AND ($gcontact_id > 0) AND ($contact["url"] != ""))
index 484c276343ba458071530b0e03170d05a78bda9d..fcd2bfec3e5c92738ce1eea0a087c60390753403 100644 (file)
--- a/index.php
+++ b/index.php
@@ -117,9 +117,15 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
 }
 
 if((x($_GET,'zrl')) && (!$install && !$maintenance)) {
-       $_SESSION['my_url'] = $_GET['zrl'];
-       $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string);
-       zrl_init($a);
+       // Only continue when the given profile link seems valid
+       // Valid profile links contain a path and no query parameters
+       if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == "") AND
+               (parse_url($_GET['zrl'],  PHP_URL_PATH) != "")) {
+               $_SESSION['my_url'] = $_GET['zrl'];
+               $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string);
+               zrl_init($a);
+       } else
+               logger("Invalid ZRL parameter ".$_GET['zrl'], LOGGER_DEBUG);
 }
 
 /**