<?php
-if(! function_exists('randprof_init')) {
-function randprof_init(&$a) {
+use Friendica\App;
+use Friendica\Core\System;
+use Friendica\Model\GlobalContact;
+
+function randprof_init(App $a) {
require_once('include/Contact.php');
+
$x = random_profile();
- if($x)
+
+ if ($x) {
goaway(zrl($x));
- goaway($a->get_baseurl() . '/profile');
-}
+ }
+
+ goaway(System::baseUrl() . '/profile');
}