]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Acctlink.php
Added type hints
[friendica.git] / src / Module / Acctlink.php
index 7f956a8250243d604341f68cf1d4546a9324609a..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($_GET, 'addr', false);
+               $addr = trim($_GET['addr'] ?? '');
 
                if ($addr) {
-                       $url = defaults(Probe::uri(trim($addr)), 'url', false);
+                       $url = Probe::uri($addr)['url'] ?? '';
 
                        if ($url) {
-                               self::getApp()->redirect($url);
+                               System::externalRedirect($url);
                                exit();
                        }
                }