friendica-github/src/Module/Acctlink.php

28 lines
453 B
PHP
Raw Normal View History

2018-10-13 16:32:14 +00:00
<?php
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Network\Probe;
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(array $parameters = [])
2018-10-13 16:32:14 +00:00
{
$addr = trim($_GET['addr'] ?? '');
2018-10-13 16:32:14 +00:00
if ($addr) {
$url = Probe::uri($addr)['url'] ?? '';
2018-10-13 16:32:14 +00:00
if ($url) {
System::externalRedirect($url);
2018-10-13 17:00:44 +00:00
exit();
2018-10-13 16:32:14 +00:00
}
}
}
}