friendica_2021-01/src/Module/Acctlink.php

28 lines
453 B
PHP
Raw Normal View History

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