]> git.mxchange.org Git - friendica.git/commitdiff
Add defaults() to url parameter in mod/follow
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 9 Mar 2019 02:53:44 +0000 (21:53 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 9 Mar 2019 02:53:44 +0000 (21:53 -0500)
- Add error redirection to /contact when url param is empty
- Addresses part of https://github.com/friendica/friendica/issues/6338#issuecomment-470681556

mod/follow.php

index abde4abd036f712866706c44e583990c727a2e16..404c79ea1048c60cfd8ade9c8f85f7e1a0d60910 100644 (file)
@@ -60,7 +60,11 @@ function follow_content(App $a)
        }
 
        $uid = local_user();
-       $url = Strings::escapeTags(trim($_REQUEST['url']));
+       $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', '')));
+
+       if (!$url) {
+               $a->internalRedirect($return_path);
+       }
 
        $submit = L10n::t('Submit Request');