From 644c08a035fec6d63cd566e70ca058c5a80d3fc1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 29 Jun 2019 19:01:07 +0000 Subject: [PATCH 1/2] Issue 4815: Silently ignoring trailing @ at follow requests --- mod/follow.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/follow.php b/mod/follow.php index 8a00e0559c..1f12f565e6 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -60,7 +60,9 @@ function follow_content(App $a) } $uid = local_user(); - $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))); + + // Issue 4815: Silently removing a trailing @ + $url = ltrim(Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))), '@!'); // Issue 6874: Allow remote following from Peertube if (strpos($url, 'acct:') === 0) { From 6cd6fa889bf55d572c791d8c07c79bc9c17d08b7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 29 Jun 2019 20:09:23 +0000 Subject: [PATCH 2/2] leading, trailing, all the same :-) --- mod/follow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/follow.php b/mod/follow.php index 1f12f565e6..c7a96f734f 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -61,7 +61,7 @@ function follow_content(App $a) $uid = local_user(); - // Issue 4815: Silently removing a trailing @ + // Issue 4815: Silently removing a prefixing @ $url = ltrim(Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))), '@!'); // Issue 6874: Allow remote following from Peertube