From 130e16968ee35dbe02b73753b0a651b9eeb411cf Mon Sep 17 00:00:00 2001
From: rabuzarus <rabuzarus@t-online.de>
Date: Thu, 12 Apr 2018 17:10:48 +0200
Subject: [PATCH 1/3] local_user() could also be a remote_user()

---
 boot.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/boot.php b/boot.php
index 65867593df..217a5f4e1d 100644
--- a/boot.php
+++ b/boot.php
@@ -953,10 +953,12 @@ function public_contact()
  */
 function remote_user()
 {
-	// You cannot be both local and remote
-	if (local_user()) {
-		return false;
-	}
+	// You cannot be both local and remote.
+	// Unncommented by rabuzarus because remote authentication to local
+	// profiles wasn't possible anymore (2018-04-12).
+//	if (local_user()) {
+//		return false;
+//	}
 	if (x($_SESSION, 'authenticated') && x($_SESSION, 'visitor_id')) {
 		return intval($_SESSION['visitor_id']);
 	}

From f9c34fee5a0793704478ece2ee25f1f8e0a33eb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20M=C3=BCller?= <marcusmueller@protonmail.com>
Date: Thu, 12 Apr 2018 19:28:52 +0200
Subject: [PATCH 2/3] [BUGFIX] Network: Remove URL/domain DNS_PTR checks

---
 src/Util/Network.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Util/Network.php b/src/Util/Network.php
index bbdc51fbbb..4a11f92595 100644
--- a/src/Util/Network.php
+++ b/src/Util/Network.php
@@ -446,7 +446,7 @@ class Network
 		/// @TODO Really suppress function outcomes? Why not find them + debug them?
 		$h = @parse_url($url);
 
-		if ((is_array($h)) && (@dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
+		if ((is_array($h)) && (@dns_get_record($h['host'], DNS_A + DNS_CNAME) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
 			return $url;
 		}
 
@@ -471,7 +471,7 @@ class Network
 
 		$h = substr($addr, strpos($addr, '@') + 1);
 
-		if (($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_PTR + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) {
+		if (($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) {
 			return true;
 		}
 		return false;

From 89ba3b78ff5e16301aba8f79ae5568edf4c34ed3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20M=C3=BCller?= <marcusmueller@protonmail.com>
Date: Thu, 12 Apr 2018 19:32:04 +0200
Subject: [PATCH 3/3] [BUGFIX] DB: Remove host DNS_PTR check

DNS_PTR checks fail on some domains and result in the return value `false`, even if the domain is valid and reachable.
---
 include/dba.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/dba.php b/include/dba.php
index 586fc092fb..208cf58121 100644
--- a/include/dba.php
+++ b/include/dba.php
@@ -53,7 +53,7 @@ class dba {
 
 		if ($install) {
 			if (strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) {
-				if (! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) {
+				if (! dns_get_record($server, DNS_A + DNS_CNAME)) {
 					self::$error = L10n::t('Cannot locate DNS info for database server \'%s\'', $server);
 					return false;
 				}