2018-10-13 12:32:14 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
|
|
|
use Friendica\Network\Probe;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
{
|
|
|
|
public static function content()
|
|
|
|
{
|
2018-10-14 04:31:11 -04:00
|
|
|
$addr = defaults($_GET, 'addr', false);
|
2018-10-13 12:32:14 -04:00
|
|
|
|
|
|
|
if ($addr) {
|
2018-10-14 04:31:11 -04:00
|
|
|
$url = defaults(Probe::uri(trim($addr)), 'url', false);
|
2018-10-13 12:32:14 -04:00
|
|
|
|
|
|
|
if ($url) {
|
2018-10-13 14:02:04 -04:00
|
|
|
self::getApp()->redirect($url);
|
2018-10-13 13:00:44 -04:00
|
|
|
exit();
|
2018-10-13 12:32:14 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|