+
+ /**
+ * Redirects to another URL and exits this process.
+ *
+ * @param string $toUrl The destination URL (Default is empty, which is the default page of the Friendica node)
+ * @param bool $ssl if true, base URL will try to get called with https:// (works just for relative paths)
+ */
+ public function redirect($toUrl = '', $ssl = false)
+ {
+ if (strstr(normalise_link($toUrl), 'http://')) {
+ $redirectTo = $toUrl;
+ } else {
+ $redirectTo = self::getApp()->getBaseURL($ssl) . '/' . ltrim($toUrl, '/');
+ }
+
+ header("Location: $redirectTo");
+ exit();
+ }