]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Issue 7285: Perform duplicate check for item URI also with AP
[friendica.git] / mod / follow.php
index 48e621f4af8da036b02c0a0530a5b2c21c0143c1..c7a96f734f6a01ad7dd9b0449618eee1e95787d3 100644 (file)
@@ -17,7 +17,7 @@ use Friendica\Util\Strings;
 function follow_post(App $a)
 {
        if (!local_user()) {
-               System::httpExit(403, ['title' => L10n::t('Access denied.')]);
+               throw new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Access denied.'));
        }
 
        if (isset($_REQUEST['cancel'])) {
@@ -60,7 +60,9 @@ function follow_content(App $a)
        }
 
        $uid = local_user();
-       $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', '')));
+
+       // Issue 4815: Silently removing a prefixing @
+       $url = ltrim(Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))), '@!');
 
        // Issue 6874: Allow remote following from Peertube
        if (strpos($url, 'acct:') === 0) {