mirror of
https://github.com/friendica/friendica
synced 2024-11-10 09:02:53 +00:00
Move Module AcctLink
This commit is contained in:
parent
14e7686df4
commit
508032cf9a
2 changed files with 26 additions and 16 deletions
|
@ -1,16 +0,0 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
||||
}
|
26
src/Module/AcctLink.php
Normal file
26
src/Module/AcctLink.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue