]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Acctlink.php
Added type hints
[friendica.git] / src / Module / Acctlink.php
index f14905277a876eaeadd3e0f755f8038bf8c5d66c..a3577da320b541952438d2ec4c152b18df019f3b 100644 (file)
@@ -4,21 +4,22 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\Network\Probe;
+use Friendica\Core\System;
 
 /**
  * Redirects to another URL based on the parameter 'addr'
  */
 class Acctlink extends BaseModule
 {
-       public static function content()
+       public static function content(array $parameters = [])
        {
-               $addr = defaults($_REQUEST, 'addr', false);
+               $addr = trim($_GET['addr'] ?? '');
 
                if ($addr) {
-                       $url = defaults(Probe::uri($addr), 'url', false);
+                       $url = Probe::uri($addr)['url'] ?? '';
 
                        if ($url) {
-                               goaway($url);
+                               System::externalRedirect($url);
                                exit();
                        }
                }