mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-12 00:24:25 +02:00
Renamed System::redirect() to $a->redirect()
This commit is contained in:
parent
c46caeb0d3
commit
2ef81108b3
62 changed files with 269 additions and 253 deletions
18
src/App.php
18
src/App.php
|
@ -1999,4 +1999,22 @@ class App
|
|||
/// @TODO Looks unsafe (remote-inclusion), is maybe not but Core\Theme::getPathForFile() uses file_exists() but does not escape anything
|
||||
require_once $template;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue