2018-10-13 16:32:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
|
|
|
use Friendica\Network\Probe;
|
2018-10-19 18:11:27 +00:00
|
|
|
use Friendica\Core\System;
|
2018-10-13 16:32:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Redirects to another URL based on the parameter 'addr'
|
|
|
|
*/
|
2018-10-13 17:00:44 +00:00
|
|
|
class Acctlink extends BaseModule
|
2018-10-13 16:32:14 +00:00
|
|
|
{
|
|
|
|
public static function content()
|
|
|
|
{
|
2018-10-14 08:31:11 +00:00
|
|
|
$addr = defaults($_GET, 'addr', false);
|
2018-10-13 16:32:14 +00:00
|
|
|
|
|
|
|
if ($addr) {
|
2018-10-14 08:31:11 +00:00
|
|
|
$url = defaults(Probe::uri(trim($addr)), 'url', false);
|
2018-10-13 16:32:14 +00:00
|
|
|
|
|
|
|
if ($url) {
|
2018-10-19 18:11:27 +00:00
|
|
|
System::externalRedirect($url);
|
2018-10-13 17:00:44 +00:00
|
|
|
exit();
|
2018-10-13 16:32:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|