From 33ffabcca77fe19aef3e0bd40005d2cb03a5daea Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Mar 2019 19:45:51 +0000 Subject: [PATCH 1/3] Issue 6874: Allow remote follow via Peertube --- mod/follow.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/follow.php b/mod/follow.php index 404c79ea10..f658ef7b2a 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -62,6 +62,9 @@ function follow_content(App $a) $uid = local_user(); $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))); + // Issue 6874: Allow remote following from Oeertube + $url = str_replace('acct:', '', $url); + if (!$url) { $a->internalRedirect($return_path); } From 09b6978e4cf8d2e00dbd5a5f2ba96e65aae36302 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Mar 2019 20:08:38 +0000 Subject: [PATCH 2/3] Oeertube or Peertube? The last one sounds better :-) --- mod/follow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/follow.php b/mod/follow.php index f658ef7b2a..9ecfdd8760 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -62,7 +62,7 @@ function follow_content(App $a) $uid = local_user(); $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))); - // Issue 6874: Allow remote following from Oeertube + // Issue 6874: Allow remote following from Peertube $url = str_replace('acct:', '', $url); if (!$url) { From cd1fc091cb1d2e8cea1c0ad20590d2710600d185 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Mar 2019 21:18:07 +0000 Subject: [PATCH 3/3] Only remove when "acct:" is the beginning --- mod/follow.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/follow.php b/mod/follow.php index 9ecfdd8760..ba4ff35f19 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -63,7 +63,9 @@ function follow_content(App $a) $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))); // Issue 6874: Allow remote following from Peertube - $url = str_replace('acct:', '', $url); + if (strpos($url, 'acct:') === 0) { + $url = str_replace('acct:', '', $url); + } if (!$url) { $a->internalRedirect($return_path);