]> git.mxchange.org Git - friendica.git/blob - mod/randprof.php
Merge pull request #6005 from nupplaphil/friendica-5996
[friendica.git] / mod / randprof.php
1 <?php
2 /**
3  * @file mod/randprof.php
4  */
5 use Friendica\App;
6 use Friendica\Core\System;
7 use Friendica\Model\Contact;
8 use Friendica\Model\GContact;
9 use Friendica\Model\Profile;
10
11 function randprof_init(App $a)
12 {
13         $x = GContact::getRandomUrl();
14
15         if ($x) {
16                 $link = Contact::magicLink($x);
17                 // @TODO making the return of magicLink save to use either externalRedirect or internalRedirect
18                 if (filter_var($link, FILTER_VALIDATE_URL)) {
19                         System::externalRedirect($link);
20                 } else {
21                         $a->internalRedirect($link);
22                 }
23         }
24
25         $a->internalRedirect('profile');
26 }