friendica-github/mod/randprof.php

27 lines
555 B
PHP
Raw Normal View History

2012-04-11 03:50:31 +00:00
<?php
/**
* @file mod/randprof.php
*/
use Friendica\App;
2017-08-26 06:04:21 +00:00
use Friendica\Core\System;
2018-06-02 08:05:06 +00:00
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
function randprof_init(App $a)
{
$x = GContact::getRandomUrl();
if ($x) {
$link = Contact::magicLink($x);
// @TODO making the return of magicLink save to use either externalRedirect or internalRedirect
if (filter_var($link, FILTER_VALIDATE_URL)) {
System::externalRedirect($link);
} else {
$a->internalRedirect($link);
}
}
$a->internalRedirect('profile');
2012-04-11 03:50:31 +00:00
}