From: Michael <heluecht@pirati.ca>
Date: Mon, 13 Mar 2017 06:32:33 +0000 (+0000)
Subject: One error, one documentation, one brace
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=44888590e5e33157ba30d1df1d4f257e184a9648;p=friendica.git

One error, one documentation, one brace
---

diff --git a/include/discover_poco.php b/include/discover_poco.php
index 6a3df27c8c..9a32790ea0 100644
--- a/include/discover_poco.php
+++ b/include/discover_poco.php
@@ -29,6 +29,14 @@ function discover_poco_run(&$argv, &$argc){
 		if ($a->maxload_reached())
 			return;
 
+	/*
+	This function can be called in these ways:
+	- dirsearch <search pattern>: Searches for "search pattern" in the directory. "search pattern" is url encoded.
+	- checkcontact: Updates gcontact entries
+	- suggestions: Discover other servers for their contacts.
+	- server <poco url>: Searches for the poco server list. "poco url" is base64 encoded.
+	*/
+
 	if(($argc > 2) && ($argv[1] == "dirsearch")) {
 		$search = urldecode($argv[2]);
 		$mode = 1;
diff --git a/include/socgraph.php b/include/socgraph.php
index e3e5773b7f..549e7c0dd2 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -431,7 +431,7 @@ function poco_detect_server($profile) {
 	// Wild guess
 	if ($server_url == "") {
 		$base = preg_replace("=(https?://)(.*?)/(.*)=ism", "$1$2", $profile);
-		if (base != $profile) {
+		if ($base != $profile) {
 			$server_url = $base;
 			$network = NETWORK_PHANTOM;
 		}
@@ -1303,7 +1303,7 @@ function poco_check_server($server_url, $network = "", $force = false) {
 			dbesc($last_failure),
 			dbesc(normalise_link($server_url))
 		);
-	} elseif (!$failure)
+	} elseif (!$failure) {
 		q("INSERT INTO `gserver` (`url`, `nurl`, `version`, `site_name`, `info`, `register_policy`, `poco`, `noscrape`, `network`, `platform`, `created`, `last_contact`, `last_failure`)
 					VALUES ('%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
 				dbesc($server_url),
@@ -1321,7 +1321,7 @@ function poco_check_server($server_url, $network = "", $force = false) {
 				dbesc($last_failure),
 				dbesc(datetime_convert())
 		);
-
+	}
 	logger("End discovery for server ".$server_url, LOGGER_DEBUG);
 
 	return !$failure;