+++ /dev/null
-<?php
-
-use Friendica\App;
-use Friendica\Network\Probe;
-
-function acctlink_init()
-{
- if (x($_GET, 'addr')) {
- $addr = trim($_GET['addr']);
- $res = Probe::uri($addr);
- if ($res['url']) {
- goaway($res['url']);
- killme();
- }
- }
-}
--- /dev/null
+<?php
+
+namespace Friendica\Module;
+
+use Friendica\BaseModule;
+use Friendica\Network\Probe;
+
+/**
+ * Redirects to another URL based on the parameter 'addr'
+ */
+class AcctLink extends BaseModule
+{
+ public static function content()
+ {
+ $addr = defaults($_REQUEST, 'addr', false);
+
+ if ($addr) {
+ $url = defaults(Probe::uri($addr), 'url', false);
+
+ if ($url) {
+ goaway($url);
+ killme();
+ }
+ }
+ }
+}