2018-10-13 12:32:14 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
|
|
|
use Friendica\Network\Probe;
|
2018-10-19 14:11:27 -04:00
|
|
|
use Friendica\Core\System;
|
2018-10-13 12:32:14 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Redirects to another URL based on the parameter 'addr'
|
|
|
|
*/
|
2018-10-13 13:00:44 -04:00
|
|
|
class Acctlink extends BaseModule
|
2018-10-13 12:32:14 -04:00
|
|
|
{
|
2019-11-05 16:48:54 -05:00
|
|
|
public static function content(array $parameters = [])
|
2018-10-13 12:32:14 -04:00
|
|
|
{
|
2019-10-15 09:20:32 -04:00
|
|
|
$addr = trim($_GET['addr'] ?? '');
|
2018-10-13 12:32:14 -04:00
|
|
|
|
|
|
|
if ($addr) {
|
2019-10-15 09:20:32 -04:00
|
|
|
$url = Probe::uri($addr)['url'] ?? '';
|
2018-10-13 12:32:14 -04:00
|
|
|
|
|
|
|
if ($url) {
|
2018-10-19 14:11:27 -04:00
|
|
|
System::externalRedirect($url);
|
2018-10-13 13:00:44 -04:00
|
|
|
exit();
|
2018-10-13 12:32:14 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|