]> git.mxchange.org Git - friendica.git/commitdiff
Refactor deprecated App::internalRedirect() to DI::baseUrl()->redirect()
authornupplaPhil <admin@philipp.info>
Sun, 15 Dec 2019 23:28:31 +0000 (00:28 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 29 Dec 2019 19:17:43 +0000 (20:17 +0100)
77 files changed:
include/items.php
mod/api.php
mod/cal.php
mod/dfrn_confirm.php
mod/dfrn_poll.php
mod/dfrn_request.php
mod/events.php
mod/follow.php
mod/item.php
mod/lostpass.php
mod/message.php
mod/network.php
mod/notifications.php
mod/ostatus_subscribe.php
mod/photos.php
mod/profile_photo.php
mod/profiles.php
mod/redir.php
mod/regmod.php
mod/removeme.php
mod/repair_ostatus.php
mod/settings.php
mod/suggest.php
mod/tagrm.php
mod/uimport.php
mod/unfollow.php
mod/videos.php
mod/wallmessage.php
src/App.php
src/App/Authentication.php
src/App/Module.php
src/BaseModule.php
src/Core/UserImport.php
src/Model/Contact.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Blocklist/Contact.php
src/Module/Admin/Blocklist/Server.php
src/Module/Admin/DBSync.php
src/Module/Admin/Features.php
src/Module/Admin/Item/Delete.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Site.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Admin/Tos.php
src/Module/Admin/Users.php
src/Module/Apps.php
src/Module/BaseAdminModule.php
src/Module/Contact.php
src/Module/Debug/Feed.php
src/Module/Delegation.php
src/Module/Filer/RemoveTag.php
src/Module/Filer/SaveTag.php
src/Module/FollowConfirm.php
src/Module/Group.php
src/Module/Home.php
src/Module/Item/Ignore.php
src/Module/Like.php
src/Module/Notifications/Notify.php
src/Module/Objects.php
src/Module/Pinned.php
src/Module/RandomProfile.php
src/Module/Register.php
src/Module/Search/Saved.php
src/Module/Security/Login.php
src/Module/Security/Logout.php
src/Module/Security/TwoFactor/Recovery.php
src/Module/Security/TwoFactor/Verify.php
src/Module/Settings/Delegation.php
src/Module/Settings/TwoFactor/AppSpecific.php
src/Module/Settings/TwoFactor/Index.php
src/Module/Settings/TwoFactor/Recovery.php
src/Module/Settings/TwoFactor/Verify.php
src/Module/Starred.php
src/Module/Tos.php

index 5ae8558d8174a6b2eb3ded51ef637d62a7a61be9..e72b97c1d24a1c6dc05d6b2c0973e8b02b78358f 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Item;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\Feed;
@@ -339,7 +340,7 @@ function drop_items(array $items)
 
 function drop_item($id, $return = '')
 {
-       $a = Friendica\DI::app();
+       $a = DI::app();
 
        // locate item to be deleted
 
@@ -348,7 +349,7 @@ function drop_item($id, $return = '')
 
        if (!DBA::isResult($item)) {
                notice(L10n::t('Item not found.') . EOL);
-               $a->internalRedirect('network');
+               DI::baseUrl()->redirect('network');
        }
 
        if ($item['deleted']) {
@@ -389,7 +390,7 @@ function drop_item($id, $return = '')
                }
                // Now check how the user responded to the confirmation query
                if (!empty($_REQUEST['canceled'])) {
-                       $a->internalRedirect('display/' . $item['guid']);
+                       DI::baseUrl()->redirect('display/' . $item['guid']);
                }
 
                $is_comment = ($item['gravity'] == GRAVITY_COMMENT) ? true : false;
@@ -411,28 +412,28 @@ function drop_item($id, $return = '')
                if ($is_comment) {
                        // Return to parent guid
                        if (!empty($parentitem)) {
-                               $a->internalRedirect('display/' . $parentitem['guid']);
+                               DI::baseUrl()->redirect('display/' . $parentitem['guid']);
                                //NOTREACHED
                        }
                        // In case something goes wrong
                        else {
-                               $a->internalRedirect('network');
+                               DI::baseUrl()->redirect('network');
                                //NOTREACHED
                        }
                }
                else {
                        // if unknown location or deleting top level post called from display
                        if (empty($return_url) || strpos($return_url, 'display') !== false) {
-                               $a->internalRedirect('network');
+                               DI::baseUrl()->redirect('network');
                                //NOTREACHED
                        } else {
-                               $a->internalRedirect($return_url);
+                               DI::baseUrl()->redirect($return_url);
                                //NOTREACHED
                        }
                }
        } else {
                notice(L10n::t('Permission denied.') . EOL);
-               $a->internalRedirect('display/' . $item['guid']);
+               DI::baseUrl()->redirect('display/' . $item['guid']);
                //NOTREACHED
        }
 }
index 929832480ac228087fde92d3f0969c2bf18c8873..8ef9f5ec4731eb196641b9961d0c778045e97d3d 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Module\Security\Login;
 
 require_once __DIR__ . '/../include/api.php';
@@ -76,7 +77,7 @@ function api_content(App $a)
                                if (strstr($consumer->callback_url, $glue)) {
                                        $glue = "?";
                                }
-                               $a->internalRedirect($consumer->callback_url . $glue . 'oauth_token=' . OAuthUtil::urlencode_rfc3986($params['oauth_token']) . '&oauth_verifier=' . OAuthUtil::urlencode_rfc3986($verifier));
+                               DI::baseUrl()->redirect($consumer->callback_url . $glue . 'oauth_token=' . OAuthUtil::urlencode_rfc3986($params['oauth_token']) . '&oauth_verifier=' . OAuthUtil::urlencode_rfc3986($verifier));
                                exit();
                        }
 
index 51d17a10a43b98cb850d25bb39d7197b0f5969d1..5a4f0a9c51731ba275fa639aa82286ff6b0af063 100644 (file)
@@ -16,12 +16,11 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Event;
-use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
-use Friendica\Protocol\DFRN;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
 
@@ -289,7 +288,7 @@ function cal_content(App $a)
                // Respect the export feature setting for all other /cal pages if it's not the own profile
                if ((local_user() !== $owner_uid) && !Feature::isEnabled($owner_uid, "export_calendar")) {
                        notice(L10n::t('Permission denied.') . EOL);
-                       $a->internalRedirect('cal/' . $nick);
+                       DI::baseUrl()->redirect('cal/' . $nick);
                }
 
                // Get the export data by uid
@@ -310,7 +309,7 @@ function cal_content(App $a)
                                $return_path = "cal/" . $nick;
                        }
 
-                       $a->internalRedirect($return_path);
+                       DI::baseUrl()->redirect($return_path);
                }
 
                // If nothing went wrong we can echo the export content
index c92e5493a1b23a7aa50e3d6ae80bae1e3222b76b..d9ba9dfac56632645ea39b6c58b089cc18e0dfcf 100644 (file)
@@ -24,6 +24,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\User;
@@ -331,7 +332,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                // Let's send our user to the contact editor in case they want to
                // do anything special with this new friend.
                if ($handsfree === null) {
-                       $a->internalRedirect('contact/' . intval($contact_id));
+                       DI::baseUrl()->redirect('contact/' . intval($contact_id));
                } else {
                        return;
                }
@@ -551,6 +552,6 @@ function dfrn_confirm_post(App $a, $handsfree = null)
        }
 
        // somebody arrived here by mistake or they are fishing. Send them to the homepage.
-       $a->internalRedirect();
+       DI::baseUrl()->redirect();
        // NOTREACHED
 }
index 7ebca9effa1ca51a7d63a14a4e071c76daece66a..002ddf924b0905c4408583b8e27e3f5d2c4557cb 100644 (file)
@@ -91,7 +91,7 @@ function dfrn_poll_init(App $a)
                                $my_id = '0:' . $dfrn_id;
                                break;
                        default:
-                               $a->internalRedirect();
+                               DI::baseUrl()->redirect();
                                break; // NOTREACHED
                }
 
@@ -138,10 +138,10 @@ function dfrn_poll_init(App $a)
                        if (!empty($destination_url)) {
                                System::externalRedirect($destination_url);
                        } else {
-                               $a->internalRedirect('profile/' . $profile);
+                               DI::baseUrl()->redirect('profile/' . $profile);
                        }
                }
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        if ($type === 'profile-check' && $dfrn_version < 2.2) {
@@ -325,7 +325,7 @@ function dfrn_poll_post(App $a)
                        $sql_extra = sprintf(" AND `dfrn-id` = '%s' AND `duplex` = 1 ", DBA::escape($dfrn_id));
                        break;
                default:
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                        break; // NOTREACHED
        }
 
@@ -445,7 +445,7 @@ function dfrn_poll_content(App $a)
                                $my_id = '0:' . $dfrn_id;
                                break;
                        default:
-                               $a->internalRedirect();
+                               DI::baseUrl()->redirect();
                                break; // NOTREACHED
                }
 
@@ -541,18 +541,18 @@ function dfrn_poll_content(App $a)
 
                        switch ($destination_url) {
                                case 'profile':
-                                       $a->internalRedirect('profile/' . $profile . '?f=&tab=profile');
+                                       DI::baseUrl()->redirect('profile/' . $profile . '?f=&tab=profile');
                                        break;
                                case 'photos':
-                                       $a->internalRedirect('photos/' . $profile);
+                                       DI::baseUrl()->redirect('photos/' . $profile);
                                        break;
                                case 'status':
                                case '':
-                                       $a->internalRedirect('profile/' . $profile);
+                                       DI::baseUrl()->redirect('profile/' . $profile);
                                        break;
                                default:
                                        $appendix = (strstr($destination_url, '?') ? '&f=&redir=1' : '?f=&redir=1');
-                                       $a->redirect($destination_url . $appendix);
+                                       DI::baseUrl()->redirect($destination_url . $appendix);
                                        break;
                        }
                        // NOTREACHED
index 28845634ad8cdfa5474856587aa26ed824e94447..f7c9d9aafc1d97ce12252f66d254ecf729142c2c 100644 (file)
@@ -21,6 +21,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Profile;
@@ -68,7 +69,7 @@ function dfrn_request_post(App $a)
        }
 
        if (!empty($_POST['cancel'])) {
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        /*
@@ -194,14 +195,14 @@ function dfrn_request_post(App $a)
                                }
 
                                // (ignore reply, nothing we can do it failed)
-                               $a->internalRedirect($forward_path);
+                               DI::baseUrl()->redirect($forward_path);
                                return; // NOTREACHED
                        }
                }
 
                // invalid/bogus request
                notice(L10n::t('Unrecoverable protocol error.') . EOL);
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
                return; // NOTREACHED
        }
 
@@ -334,19 +335,19 @@ function dfrn_request_post(App $a)
                                $url = Network::isUrlValid($url);
                                if (!$url) {
                                        notice(L10n::t('Invalid profile URL.') . EOL);
-                                       $a->internalRedirect($a->cmd);
+                                       DI::baseUrl()->redirect($a->cmd);
                                        return; // NOTREACHED
                                }
 
                                if (!Network::isUrlAllowed($url)) {
                                        notice(L10n::t('Disallowed profile URL.') . EOL);
-                                       $a->internalRedirect($a->cmd);
+                                       DI::baseUrl()->redirect($a->cmd);
                                        return; // NOTREACHED
                                }
 
                                if (Network::isUrlBlocked($url)) {
                                        notice(L10n::t('Blocked domain') . EOL);
-                                       $a->internalRedirect($a->cmd);
+                                       DI::baseUrl()->redirect($a->cmd);
                                        return; // NOTREACHED
                                }
 
@@ -354,7 +355,7 @@ function dfrn_request_post(App $a)
 
                                if (!count($parms)) {
                                        notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
-                                       $a->internalRedirect($a->cmd);
+                                       DI::baseUrl()->redirect($a->cmd);
                                } else {
                                        if (empty($parms['fn'])) {
                                                notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
index 1a8eccde11be6ebf4ee159e9aa9b53c8060755c9..ddcac1bd154f0939980d306d709b4e65516b4d9e 100644 (file)
@@ -15,6 +15,7 @@ use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Event;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
@@ -123,7 +124,7 @@ function events_post(App $a)
                        echo L10n::t('Event can not end before it has started.');
                        exit();
                }
-               $a->internalRedirect($onerror_path);
+               DI::baseUrl()->redirect($onerror_path);
        }
 
        if (!$summary || ($start === DBA::NULL_DATETIME)) {
@@ -132,7 +133,7 @@ function events_post(App $a)
                        echo L10n::t('Event title and start time are required.');
                        exit();
                }
-               $a->internalRedirect($onerror_path);
+               DI::baseUrl()->redirect($onerror_path);
        }
 
        $share = intval($_POST['share'] ?? 0);
@@ -150,7 +151,7 @@ function events_post(App $a)
 
        if ($share) {
 
-               $aclFormatter = \Friendica\DI::aclFormatter();
+               $aclFormatter = DI::aclFormatter();
 
                $str_group_allow   = $aclFormatter->toString($_POST['group_allow'] ?? '');
                $str_contact_allow = $aclFormatter->toString($_POST['contact_allow'] ?? '');
@@ -205,7 +206,7 @@ function events_post(App $a)
                Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $item_id);
        }
 
-       $a->internalRedirect('events');
+       DI::baseUrl()->redirect('events');
 }
 
 function events_content(App $a)
@@ -578,6 +579,6 @@ function events_content(App $a)
                        info(L10n::t('Event removed') . EOL);
                }
 
-               $a->internalRedirect('events');
+               DI::baseUrl()->redirect('events');
        }
 }
index 31b92aa0dc06eb6873de05af9f3a647febc5901e..94db3ad38dafbb1106645c4b98938da040530d86 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 use Friendica\Network\Probe;
@@ -21,7 +22,7 @@ function follow_post(App $a)
        }
 
        if (isset($_REQUEST['cancel'])) {
-               $a->internalRedirect('contact');
+               DI::baseUrl()->redirect('contact');
        }
 
        $uid = local_user();
@@ -38,14 +39,14 @@ function follow_post(App $a)
                if ($result['message']) {
                        notice($result['message']);
                }
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
        } elseif ($result['cid']) {
-               $a->internalRedirect('contact/' . $result['cid']);
+               DI::baseUrl()->redirect('contact/' . $result['cid']);
        }
 
        info(L10n::t('The contact could not be added.'));
 
-       $a->internalRedirect($return_path);
+       DI::baseUrl()->redirect($return_path);
        // NOTREACHED
 }
 
@@ -55,7 +56,7 @@ function follow_content(App $a)
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
 
@@ -70,7 +71,7 @@ function follow_content(App $a)
        }
 
        if (!$url) {
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
        }
 
        $submit = L10n::t('Submit Request');
@@ -132,7 +133,7 @@ function follow_content(App $a)
 
        if (!$r) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
 
index e20fb995217a6984b57323a48b4896cd7d1a27dd..9326bf60d90ae478cee8c96ae2579d46219fb950 100644 (file)
@@ -125,7 +125,7 @@ function item_post(App $a) {
                if (!DBA::isResult($toplevel_item)) {
                        notice(L10n::t('Unable to locate original post.') . EOL);
                        if (!empty($_REQUEST['return'])) {
-                               $a->internalRedirect($return_path);
+                               DI::baseUrl()->redirect($return_path);
                        }
                        exit();
                }
@@ -173,7 +173,7 @@ function item_post(App $a) {
                notice(L10n::t('Permission denied.') . EOL);
 
                if (!empty($_REQUEST['return'])) {
-                       $a->internalRedirect($return_path);
+                       DI::baseUrl()->redirect($return_path);
                }
 
                exit();
@@ -327,7 +327,7 @@ function item_post(App $a) {
                        }
                        info(L10n::t('Empty post discarded.') . EOL);
                        if (!empty($_REQUEST['return'])) {
-                               $a->internalRedirect($return_path);
+                               DI::baseUrl()->redirect($return_path);
                        }
                        exit();
                }
@@ -678,7 +678,7 @@ function item_post(App $a) {
        if (!empty($datarray['cancel'])) {
                Logger::log('mod_item: post cancelled by addon.');
                if ($return_path) {
-                       $a->internalRedirect($return_path);
+                       DI::baseUrl()->redirect($return_path);
                }
 
                $json = ['cancel' => 1];
@@ -713,7 +713,7 @@ function item_post(App $a) {
 
                if (!empty($_REQUEST['return']) && strlen($return_path)) {
                        Logger::log('return: ' . $return_path);
-                       $a->internalRedirect($return_path);
+                       DI::baseUrl()->redirect($return_path);
                }
                exit();
        }
@@ -733,14 +733,14 @@ function item_post(App $a) {
 
        if (!$post_id) {
                Logger::log("Item wasn't stored.");
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
        }
 
        $datarray = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);
 
        if (!DBA::isResult($datarray)) {
                Logger::log("Item with id ".$post_id." couldn't be fetched.");
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
        }
 
        // update filetags in pconfig
@@ -855,7 +855,7 @@ function item_post_return($baseurl, $api_source, $return_path)
        }
 
        if ($return_path) {
-               $a->internalRedirect($return_path);
+               DI::baseUrl()->redirect($return_path);
        }
 
        $json = ['success' => 1];
index ecab0982c86d4f43a5d60e6dcbda724ffc547de2..5d28143fea2dfcb18141f217a128e5a0f3be2841 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Strings;
@@ -18,14 +19,14 @@ function lostpass_post(App $a)
 {
        $loginame = Strings::escapeTags(trim($_POST['login-name']));
        if (!$loginame) {
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
        $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
        if (!DBA::isResult($user)) {
                notice(L10n::t('No valid account found.') . EOL);
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        $pwdreset_token = Strings::getRandomName(12) . random_int(1000, 9999);
@@ -77,7 +78,7 @@ function lostpass_post(App $a)
                'body'     => $body
        ]);
 
-       $a->internalRedirect();
+       DI::baseUrl()->redirect();
 }
 
 function lostpass_content(App $a)
index 8efe825cd96795faff5c3a566eef723ce5b6d728..6944dfa6792f6d7590b4006c946944264c3fdcb6 100644 (file)
@@ -13,6 +13,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Mail;
 use Friendica\Module\Security\Login;
@@ -88,7 +89,7 @@ function message_post(App $a)
                $a->argc = 2;
                $a->argv[1] = 'new';
        } else {
-               $a->internalRedirect($a->cmd . '/' . $ret);
+               DI::baseUrl()->redirect($a->cmd . '/' . $ret);
        }
 }
 
@@ -156,7 +157,7 @@ function message_content(App $a)
 
                // Now check how the user responded to the confirmation query
                if (!empty($_REQUEST['canceled'])) {
-                       $a->internalRedirect('message');
+                       DI::baseUrl()->redirect('message');
                }
 
                $cmd = $a->argv[1];
@@ -164,7 +165,7 @@ function message_content(App $a)
                        $message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
                        if(!DBA::isResult($message)){
                                info(L10n::t('Conversation not found.') . EOL);
-                               $a->internalRedirect('message');
+                               DI::baseUrl()->redirect('message');
                        }
 
                        if (DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
@@ -174,10 +175,10 @@ function message_content(App $a)
                        $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
                        if(!DBA::isResult($conversation)){
                                info(L10n::t('Conversation removed.') . EOL);
-                               $a->internalRedirect('message');
+                               DI::baseUrl()->redirect('message');
                        }
 
-                       $a->internalRedirect('message/' . $conversation['id'] );
+                       DI::baseUrl()->redirectinternalRedirect('message/' . $conversation['id'] );
                } else {
                        $r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval($a->argv[2]),
@@ -190,7 +191,7 @@ function message_content(App $a)
                                        info(L10n::t('Conversation removed.') . EOL);
                                }
                        }
-                       $a->internalRedirect('message');
+                       DI::baseUrl()->redirect('message');
                }
        }
 
index 037620340115fb24a5e7ec14130b227616cffee1..14f70c9d659e8d6a1dad84f93c774e531c77d40f 100644 (file)
@@ -128,7 +128,7 @@ function network_init(App $a)
 
                        $redir_url = ($net_queries ? $net_baseurl . '?' . $net_queries : $net_baseurl);
 
-                       $a->internalRedirect($redir_url);
+                       DI::baseUrl()->redirect($redir_url);
                }
        }
 
@@ -587,7 +587,7 @@ function networkThreadedView(App $a, $update, $parent)
                                exit();
                        }
                        notice(L10n::t('No such group') . EOL);
-                       $a->internalRedirect('network/0');
+                       DI::baseUrl()->redirect('network/0');
                        // NOTREACHED
                }
 
@@ -641,7 +641,7 @@ function networkThreadedView(App $a, $update, $parent)
                        }
                } else {
                        notice(L10n::t('Invalid contact.') . EOL);
-                       $a->internalRedirect('network');
+                       DI::baseUrl()->redirect('network');
                        // NOTREACHED
                }
        }
index e083e3b44cc1631a878f3988e82b72e09dfbd886..7e1d2cff9e9f1fdbbad4a58f60c00896e254063b 100644 (file)
@@ -17,12 +17,11 @@ use Friendica\DI;
 use Friendica\Module\Security\Login;
 use Friendica\Model\Contact;
 use Friendica\Model\Introduction;
-use Friendica\Model\Notify;
 
 function notifications_post(App $a)
 {
        if (!local_user()) {
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        $request_id = (($a->argc > 1) ? $a->argv[1] : 0);
@@ -45,7 +44,7 @@ function notifications_post(App $a)
                                break;
                }
 
-               $a->internalRedirect('notifications/intros');
+               DI::baseUrl()->redirect('notifications/intros');
        }
 }
 
@@ -113,7 +112,7 @@ function notifications_content(App $a)
                $notifs = $nm->getHomeList($show, $startrec, $perpage);
        // fallback - redirect to main page
        } else {
-               $a->internalRedirect('notifications');
+               DI::baseUrl()->redirect('notifications');
        }
 
        // Set the pager
index 7f9725b85359ca7163078ef1a0f9c03610c397f6..f112a2ef916b848b88823a042e0e73c5c43844e8 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Network\Probe;
 use Friendica\Util\Network;
@@ -16,7 +17,7 @@ function ostatus_subscribe_content(App $a)
 {
        if (!local_user()) {
                notice(L10n::t('Permission denied.') . EOL);
-               $a->internalRedirect('ostatus_subscribe');
+               DI::baseUrl()->redirect('ostatus_subscribe');
                // NOTREACHED
        }
 
index a3d81c041de811bf3f0e5b5f293af1ce1bb8711e..fd1d6200f37681eb19c0936a9b67f6ba83c1e625 100644 (file)
@@ -173,12 +173,12 @@ function photos_post(App $a)
 
        if ($a->argc > 3 && $a->argv[2] === 'album') {
                if (!Strings::isHex($a->argv[3])) {
-                       $a->internalRedirect('photos/' . $a->data['user']['nickname'] . '/album');
+                       DI::baseUrl()->redirect('photos/' . $a->data['user']['nickname'] . '/album');
                }
                $album = hex2bin($a->argv[3]);
 
                if ($album === L10n::t('Profile Photos') || $album === 'Contact Photos' || $album === L10n::t('Contact Photos')) {
-                       $a->internalRedirect($_SESSION['photo_return']);
+                       DI::baseUrl()->redirect($_SESSION['photo_return']);
                        return; // NOTREACHED
                }
 
@@ -189,13 +189,13 @@ function photos_post(App $a)
 
                if (!DBA::isResult($r)) {
                        notice(L10n::t('Album not found.') . EOL);
-                       $a->internalRedirect($_SESSION['photo_return']);
+                       DI::baseUrl()->redirect($_SESSION['photo_return']);
                        return; // NOTREACHED
                }
 
                // Check if the user has responded to a delete confirmation query
                if (!empty($_REQUEST['canceled'])) {
-                       $a->internalRedirect($_SESSION['photo_return']);
+                       DI::baseUrl()->redirect($_SESSION['photo_return']);
                }
 
                // RENAME photo album
@@ -209,7 +209,7 @@ function photos_post(App $a)
                        // Update the photo albums cache
                        Photo::clearAlbumCache($page_owner_uid);
 
-                       $a->internalRedirect('photos/' . $a->user['nickname'] . '/album/' . bin2hex($newalbum));
+                       DI::baseUrl()->redirect('photos/' . $a->user['nickname'] . '/album/' . bin2hex($newalbum));
                        return; // NOTREACHED
                }
 
@@ -252,13 +252,13 @@ function photos_post(App $a)
                        }
                }
 
-               $a->internalRedirect('photos/' . $a->argv[1]);
+               DI::baseUrl()->redirect('photos/' . $a->argv[1]);
        }
 
        if ($a->argc > 3 && $a->argv[2] === 'image') {
                // Check if the user has responded to a delete confirmation query for a single photo
                if (!empty($_POST['canceled'])) {
-                       $a->internalRedirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
+                       DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
                }
 
                if (!empty($_POST['delete'])) {
@@ -282,10 +282,10 @@ function photos_post(App $a)
                                notice('Successfully deleted the photo.');
                        } else {
                                notice('Failed to delete the photo.');
-                               $a->internalRedirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
+                               DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
                        }
 
-                       $a->internalRedirect('photos/' . $a->argv[1]);
+                       DI::baseUrl()->redirect('photos/' . $a->argv[1]);
                        return; // NOTREACHED
                }
        }
@@ -591,7 +591,7 @@ function photos_post(App $a)
                                }
                        }
                }
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
                return; // NOTREACHED
        }
 
@@ -817,7 +817,7 @@ function photos_post(App $a)
        // addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook
        // if they do not wish to be redirected
 
-       $a->internalRedirect($_SESSION['photo_return']);
+       DI::baseUrl()->redirect($_SESSION['photo_return']);
        // NOTREACHED
 }
 
@@ -994,7 +994,7 @@ function photos_content(App $a)
        if ($datatype === 'album') {
                // if $datum is not a valid hex, redirect to the default page
                if (!Strings::isHex($datum)) {
-                       $a->internalRedirect('photos/' . $a->data['user']['nickname']. '/album');
+                       DI::baseUrl()->redirect('photos/' . $a->data['user']['nickname']. '/album');
                }
                $album = hex2bin($datum);
 
index 97d2da349c88bd72955596f3cf4cabd4fae6b0b7..412d19029eac6e34f287c2f3c00de26892cf19f9 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Photo;
 use Friendica\Model\Profile;
@@ -134,7 +135,7 @@ function profile_photo_post(App $a)
                        }
                }
 
-               $a->internalRedirect($path);
+               DI::baseUrl()->redirect($path);
                return; // NOTREACHED
        }
 
@@ -167,7 +168,7 @@ function profile_photo_post(App $a)
        @unlink($src);
 
        $imagecrop = profile_photo_crop_ui_head($a, $ph);
-       $a->internalRedirect('profile_photo/use/' . $imagecrop['hash']);
+       DI::baseUrl()->redirect('profile_photo/use/' . $imagecrop['hash']);
 }
 
 function profile_photo_content(App $a)
@@ -222,7 +223,7 @@ function profile_photo_content(App $a)
                                Worker::add(PRIORITY_LOW, "Directory", $url);
                        }
 
-                       $a->internalRedirect('profile/' . $a->user['nickname']);
+                       DI::baseUrl()->redirect('profile/' . $a->user['nickname']);
                        return; // NOTREACHED
                }
                $ph = Photo::getImageForPhoto($r[0]);
index 46bc36db5313d8142f3b1c4815f534678a66ac84..e298df668c572f6977c4695139484aecabc24e48 100644 (file)
@@ -16,6 +16,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Model\Profile;
@@ -41,7 +42,7 @@ function profiles_init(App $a) {
                );
                if (! DBA::isResult($r)) {
                        notice(L10n::t('Profile not found.') . EOL);
-                       $a->internalRedirect('profiles');
+                       DI::baseUrl()->redirect('profiles');
                        return; // NOTREACHED
                }
 
@@ -62,7 +63,7 @@ function profiles_init(App $a) {
                        info(L10n::t('Profile deleted.').EOL);
                }
 
-               $a->internalRedirect('profiles');
+               DI::baseUrl()->redirect('profiles');
                return; // NOTREACHED
        }
 
@@ -96,10 +97,10 @@ function profiles_init(App $a) {
 
                info(L10n::t('New profile created.') . EOL);
                if (DBA::isResult($r3) && count($r3) == 1) {
-                       $a->internalRedirect('profiles/' . $r3[0]['id']);
+                       DI::baseUrl()->redirect('profiles/' . $r3[0]['id']);
                }
 
-               $a->internalRedirect('profiles');
+               DI::baseUrl()->redirect('profiles');
        }
 
        if (($a->argc > 2) && ($a->argv[1] === 'clone')) {
@@ -134,10 +135,10 @@ function profiles_init(App $a) {
                );
                info(L10n::t('New profile created.') . EOL);
                if ((DBA::isResult($r3)) && (count($r3) == 1)) {
-                       $a->internalRedirect('profiles/'.$r3[0]['id']);
+                       DI::baseUrl()->redirect('profiles/'.$r3[0]['id']);
                }
 
-               $a->internalRedirect('profiles');
+               DI::baseUrl()->redirect('profiles');
 
                return; // NOTREACHED
        }
@@ -640,7 +641,7 @@ function profiles_content(App $a) {
                        );
                        if (DBA::isResult($r)) {
                                //Go to the default profile.
-                               $a->internalRedirect('profiles/' . $r[0]['id']);
+                               DI::baseUrl()->redirect('profiles/' . $r[0]['id']);
                        }
                }
 
index 9d86f27a9624a70adcc8b86d11e76d4f20a63ee8..57f96a7ac6d9e73ee62f66ad4c4a281895f09583 100644 (file)
@@ -6,6 +6,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 use Friendica\Util\Network;
@@ -30,7 +31,7 @@ function redir_init(App $a) {
                $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
                if (!DBA::isResult($contact)) {
                        notice(L10n::t('Contact not found.'));
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                $contact_url = $contact['url'];
@@ -120,7 +121,7 @@ function redir_init(App $a) {
        }
 
        notice(L10n::t('Contact not found.'));
-       $a->internalRedirect();
+       DI::baseUrl()->redirect();
 }
 
 function redir_magic($a, $cid, $url)
index 78cba8a2abf82c0cd98c333879c3ec96bc92c114..0fc5a889940c85758da8341175f1de996e15f843 100644 (file)
@@ -9,6 +9,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Register;
 use Friendica\Model\User;
 use Friendica\Module\Security\Login;
@@ -98,11 +99,11 @@ function regmod_content(App $a)
 
        if ($cmd === 'deny') {
                user_deny($hash);
-               $a->internalRedirect('admin/users/');
+               DI::baseUrl()->redirect('admin/users/');
        }
 
        if ($cmd === 'allow') {
                user_allow($hash);
-               $a->internalRedirect('admin/users/');
+               DI::baseUrl()->redirect('admin/users/');
        }
 }
index 7ed0d1da90244d1688d96576e3d6818da0eb7587..30e332d328d070ffdfb72c749760cd6021db40ca 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Util\Strings;
 
@@ -59,7 +60,7 @@ function removeme_post(App $a)
 
                unset($_SESSION['authenticated']);
                unset($_SESSION['uid']);
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
                // NOTREACHED
        }
 }
@@ -67,7 +68,7 @@ function removeme_post(App $a)
 function removeme_content(App $a)
 {
        if (!local_user()) {
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        $hash = Strings::getRandomHex();
index 51a6aadaad6659753ad30b62584c1ea266b3b266..f1a86e6b2343f30b3abae54f07a45c83aef6719d 100644 (file)
@@ -8,13 +8,14 @@ use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 
 function repair_ostatus_content(App $a) {
 
        if (! local_user()) {
                notice(L10n::t('Permission denied.') . EOL);
-               $a->internalRedirect('ostatus_repair');
+               DI::baseUrl()->redirect('ostatus_repair');
                // NOTREACHED
        }
 
index b126defcbab6b0d9071daa3ecd6282fbcb85325f..416a8adcda88c19aa652fa010365617304b9f4ca 100644 (file)
@@ -173,7 +173,7 @@ function settings_post(App $a)
 
                $key = $_POST['remove'];
                DBA::delete('tokens', ['id' => $key, 'uid' => local_user()]);
-               $a->internalRedirect('settings/oauth/', true);
+               DI::baseUrl()->redirect('settings/oauth/', true);
                return;
        }
 
@@ -219,7 +219,7 @@ function settings_post(App $a)
                                );
                        }
                }
-               $a->internalRedirect('settings/oauth/', true);
+               DI::baseUrl()->redirect('settings/oauth/', true);
                return;
        }
 
@@ -383,7 +383,7 @@ function settings_post(App $a)
                }
 
                Hook::callAll('display_settings_post', $_POST);
-               $a->internalRedirect('settings/display');
+               DI::baseUrl()->redirect('settings/display');
                return; // NOTREACHED
        }
 
@@ -419,7 +419,7 @@ function settings_post(App $a)
        if (!empty($_POST['resend_relocate'])) {
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
                info(L10n::t("Relocate message has been send to your contacts"));
-               $a->internalRedirect('settings');
+               DI::baseUrl()->redirect('settings');
        }
 
        Hook::callAll('settings_post', $_POST);
@@ -638,7 +638,7 @@ function settings_post(App $a)
        // Update the global contact for the user
        GContact::updateForUser(local_user());
 
-       $a->internalRedirect('settings');
+       DI::baseUrl()->redirect('settings');
        return; // NOTREACHED
 }
 
@@ -705,7 +705,7 @@ function settings_content(App $a)
                        BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
 
                        DBA::delete('clients', ['client_id' => $a->argv[3], 'uid' => local_user()]);
-                       $a->internalRedirect('settings/oauth/', true);
+                       DI::baseUrl()->redirect('settings/oauth/', true);
                        return;
                }
 
index 4b67dd6eb8e7930b6d217c7dc46024d55707956f..86c7f7afdf4c759a4f4bc81ff1aed1f5aeae683c 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Util\Proxy as ProxyUtils;
@@ -28,7 +29,7 @@ function suggest_post(App $a)
                notice(L10n::t('Contact suggestion successfully ignored.'));
        }
 
-       $a->internalRedirect('suggest');
+       DI::baseUrl()->redirect('suggest');
 }
 
 function suggest_content(App $a)
index 3f091f298ac5ac4e159964cd73abe513c0e77225..267ee718cc04280ab01a5e163dbf8ba42c7cdeab 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\L10n;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Item;
 use Friendica\Model\Term;
 use Friendica\Util\Strings;
@@ -14,11 +15,11 @@ use Friendica\Util\Strings;
 function tagrm_post(App $a)
 {
        if (!local_user()) {
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
        if (!empty($_POST['submit']) && ($_POST['submit'] === L10n::t('Cancel'))) {
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
        $tags = [];
@@ -30,7 +31,7 @@ function tagrm_post(App $a)
        update_tags($item_id, $tags);
        info(L10n::t('Tag(s) removed') . EOL);
 
-       $a->internalRedirect($_SESSION['photo_return']);
+       DI::baseUrl()->redirect($_SESSION['photo_return']);
        // NOTREACHED
 }
 
@@ -71,31 +72,31 @@ function tagrm_content(App $a)
        $o = '';
 
        if (!local_user()) {
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
                // NOTREACHED
        }
 
        if ($a->argc == 3) {
                update_tags($a->argv[1], [Strings::escapeTags(trim(hex2bin($a->argv[2])))]);
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
        $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
        if (!$item_id) {
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
                // NOTREACHED
        }
 
        $item = Item::selectFirst(['tag'], ['id' => $item_id, 'uid' => local_user()]);
        if (!DBA::isResult($item)) {
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
        $arr = explode(',', $item['tag']);
 
 
        if (empty($item['tag'])) {
-               $a->internalRedirect($_SESSION['photo_return']);
+               DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
        $o .= '<h3>' . L10n::t('Remove Item Tag') . '</h3>';
index 436802265b2a85c1dc272534ff1b6ff4db913145..b1cb8f82a5b0f59dd1172a33dc0712b516553d81 100644 (file)
@@ -19,7 +19,7 @@ function uimport_post(App $a)
        }
 
        if (!empty($_FILES['accountfile'])) {
-               UserImport::importAccount($a, $_FILES['accountfile']);
+               UserImport::importAccount($_FILES['accountfile']);
                return;
        }
 }
index 7afd82c98a95b25f3e5e8a9ed3849e3706ec5ee1..c7ad413d225e34eda1cac94a99244043da3d1d41 100644 (file)
@@ -9,6 +9,7 @@ use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 use Friendica\Model\User;
@@ -20,7 +21,7 @@ function unfollow_post(App $a)
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect('login');
+               DI::baseUrl()->redirect('login');
                // NOTREACHED
        }
 
@@ -34,17 +35,17 @@ function unfollow_post(App $a)
 
        if (!DBA::isResult($contact)) {
                notice(L10n::t("You aren't following this contact."));
-               $a->internalRedirect($base_return_path);
+               DI::baseUrl()->redirect($base_return_path);
                // NOTREACHED
        }
 
        if (!empty($_REQUEST['cancel'])) {
-               $a->internalRedirect($base_return_path . '/' . $contact['id']);
+               DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
        }
 
        if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
                notice(L10n::t('Unfollowing is currently not supported by your network.'));
-               $a->internalRedirect($base_return_path . '/' . $contact['id']);
+               DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
                // NOTREACHED
        }
 
@@ -65,7 +66,7 @@ function unfollow_post(App $a)
        }
 
        info(L10n::t('Contact unfollowed'));
-       $a->internalRedirect($return_path);
+       DI::baseUrl()->redirect($return_path);
        // NOTREACHED
 }
 
@@ -75,7 +76,7 @@ function unfollow_content(App $a)
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect('login');
+               DI::baseUrl()->redirect('login');
                // NOTREACHED
        }
 
@@ -90,13 +91,13 @@ function unfollow_content(App $a)
 
        if (!DBA::isResult($contact)) {
                notice(L10n::t("You aren't following this contact."));
-               $a->internalRedirect($base_return_path);
+               DI::baseUrl()->redirect($base_return_path);
                // NOTREACHED
        }
 
        if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
                notice(L10n::t('Unfollowing is currently not supported by your network.'));
-               $a->internalRedirect($base_return_path . '/' . $contact['id']);
+               DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
                // NOTREACHED
        }
 
@@ -107,7 +108,7 @@ function unfollow_content(App $a)
 
        if (!DBA::isResult($self)) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect($base_return_path);
+               DI::baseUrl()->redirect($base_return_path);
                // NOTREACHED
        }
 
index 4174c7f48a2fed181d9fac8ed88560f4a319ca0f..c6f342aa70c332bf7ce1762017577e34d159d8a2 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Attach;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
@@ -75,7 +76,7 @@ function videos_post(App $a)
        $owner_uid = $a->data['user']['uid'];
 
        if (local_user() != $owner_uid) {
-               $a->internalRedirect('videos/' . $a->data['user']['nickname']);
+               DI::baseUrl()->redirect('videos/' . $a->data['user']['nickname']);
        }
 
        if (($a->argc == 2) && !empty($_POST['delete']) && !empty($_POST['id'])) {
@@ -92,11 +93,11 @@ function videos_post(App $a)
                        ], local_user());
                }
 
-               $a->internalRedirect('videos/' . $a->data['user']['nickname']);
+               DI::baseUrl()->redirect('videos/' . $a->data['user']['nickname']);
                return; // NOTREACHED
        }
 
-       $a->internalRedirect('videos/' . $a->data['user']['nickname']);
+       DI::baseUrl()->redirect('videos/' . $a->data['user']['nickname']);
 }
 
 function videos_content(App $a)
index ad8ca96675d638b5a3a80651843423af9339c9f3..eaa3174f4a2e67a6cecc1b809d62431bcd0cd908 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Mail;
 use Friendica\Model\Profile;
 use Friendica\Util\Strings;
@@ -72,7 +73,7 @@ function wallmessage_post(App $a) {
                        info(L10n::t('Message sent.') . EOL);
        }
 
-       $a->internalRedirect('profile/'.$user['nickname']);
+       DI::baseUrl()->redirect('profile/'.$user['nickname']);
 }
 
 
index c0c38785387b516b9839bb046ccaaebcee2770e1..65ab3be53d4d7efe6c6267c232b235a01551baa9 100644 (file)
@@ -681,9 +681,9 @@ class App
                        // in install mode, any url loads install module
                        // but we need "view" module for stylesheet
                        if ($this->mode->isInstall() && $moduleName !== 'install') {
-                               $this->internalRedirect('install');
+                               $this->baseURL->redirect('install');
                        } elseif (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'maintenance') {
-                               $this->internalRedirect('maintenance');
+                               $this->baseURL->redirect('maintenance');
                        } else {
                                $this->checkURL();
                                Core\Update::check($this->getBasePath(), false, $this->mode);
@@ -693,35 +693,35 @@ class App
 
                        // Compatibility with the Android Diaspora client
                        if ($moduleName == 'stream') {
-                               $this->internalRedirect('network?order=post');
+                               $this->baseURL->redirect('network?order=post');
                        }
 
                        if ($moduleName == 'conversations') {
-                               $this->internalRedirect('message');
+                               $this->baseURL->redirect('message');
                        }
 
                        if ($moduleName == 'commented') {
-                               $this->internalRedirect('network?order=comment');
+                               $this->baseURL->redirect('network?order=comment');
                        }
 
                        if ($moduleName == 'liked') {
-                               $this->internalRedirect('network?order=comment');
+                               $this->baseURL->redirect('network?order=comment');
                        }
 
                        if ($moduleName == 'activity') {
-                               $this->internalRedirect('network?conv=1');
+                               $this->baseURL->redirect('network?conv=1');
                        }
 
                        if (($moduleName == 'status_messages') && ($this->args->getCommand() == 'status_messages/new')) {
-                               $this->internalRedirect('bookmarklet');
+                               $this->baseURL->redirect('bookmarklet');
                        }
 
                        if (($moduleName == 'user') && ($this->args->getCommand() == 'user/edit')) {
-                               $this->internalRedirect('settings');
+                               $this->baseURL->redirect('settings');
                        }
 
                        if (($moduleName == 'tag_followings') && ($this->args->getCommand() == 'tag_followings/manage')) {
-                               $this->internalRedirect('search');
+                               $this->baseURL->redirect('search');
                        }
 
                        // Initialize module that can set the current theme in the init() method, either directly or via App->profile_uid
@@ -732,7 +732,7 @@ class App
                        $module = $module->determineClass($this->args, $router, $this->config);
 
                        // Let the module run it's internal process (init, get, post, ...)
-                       $module->run($this->l10n, $this, $this->logger, $_SERVER, $_POST);
+                       $module->run($this->l10n, $this->baseURL, $this->logger, $_SERVER, $_POST);
                } catch (HTTPException $e) {
                        ModuleHTTPException::rawContent($e);
                }
@@ -740,15 +740,6 @@ class App
                $this->page->run($this, $this->baseURL, $this->mode, $module, $this->l10n, $this->config, $pconfig);
        }
 
-       /**
-        * @deprecated 2019.12 use BaseUrl::redirect instead
-        * @see BaseURL::redirect()
-        */
-       public function internalRedirect($toUrl = '', $ssl = false)
-       {
-               $this->baseURL->redirect($toUrl, $ssl);
-       }
-
        /**
         * Automatically redirects to relative or absolute URL
         * Should only be used if it isn't clear if the URL is either internal or external
index b1424e0fd63ea9e3ea9377c0790341712ad0c9d3..f9d14171e9de02f33e8c67a042f18bae42744e7b 100644 (file)
@@ -407,7 +407,7 @@ class Authentication
                if ($a->isAjax()) {
                        throw new HTTPException\ForbiddenException();
                } else {
-                       $a->internalRedirect('2fa');
+                       $this->baseUrl->redirect('2fa');
                }
        }
 }
index 39111c95016627239499389063f728ab4700c0c7..51be234937d9bf19b329bba9f728f41b384b54ba 100644 (file)
@@ -208,14 +208,14 @@ class Module
         * Run the determined module class and calls all hooks applied to
         *
         * @param Core\L10n\L10n  $l10n         The L10n instance
-        * @param App             $app          The whole Friendica app (for method arguments)
+        * @param App\BaseURL     $baseUrl      The Friendica Base URL
         * @param LoggerInterface $logger       The Friendica logger
         * @param array           $server       The $_SERVER variable
         * @param array           $post         The $_POST variables
         *
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function run(Core\L10n\L10n $l10n, App $app, LoggerInterface $logger, array $server, array $post)
+       public function run(Core\L10n\L10n $l10n, App\BaseURL $baseUrl, LoggerInterface $logger, array $server, array $post)
        {
                if ($this->printNotAllowedAddon) {
                        info($l10n->t("You must be logged in to use addons. "));
@@ -239,7 +239,7 @@ class Module
 
                        if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
                                $logger->info('index.php: dreamhost_error_hack invoked.', ['Original URI' => $server['REQUEST_URI']]);
-                               $app->internalRedirect($server['REQUEST_URI']);
+                               $baseUrl->redirect($server['REQUEST_URI']);
                        }
 
                        $logger->debug('index.php: page not found.', ['request_uri' => $server['REQUEST_URI'], 'address' => $server['REMOTE_ADDR'], 'query' => $server['QUERY_STRING']]);
index 3d6a3f691f27fe640d02cb6eea48412a702ec20f..dcacce78bbd5623fcc82156939cddff575e907d8 100644 (file)
@@ -140,7 +140,7 @@ abstract class BaseModule
                        Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
                        Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
                        notice(self::getFormSecurityStandardErrorMessage());
-                       $a->internalRedirect($err_redirect);
+                       DI::baseUrl()->redirect($err_redirect);
                }
        }
 
index 71767e8cef788be4cfa1f90b7c189d7dac63ad13..b06e01e9f7aa3b4d42be8c938f40c4566adddc52 100644 (file)
@@ -7,6 +7,7 @@ namespace Friendica\Core;
 use Friendica\App;
 use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
+use Friendica\DI;
 use Friendica\Model\Photo;
 use Friendica\Object\Image;
 use Friendica\Util\Strings;
@@ -85,12 +86,11 @@ class UserImport
        /**
         * @brief Import account file exported from mod/uexport
         *
-        * @param App   $a    Friendica App Class
         * @param array $file array from $_FILES
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function importAccount(App $a, $file)
+       public static function importAccount($file)
        {
                Logger::log("Start user import from " . $file['tmp_name']);
                /*
@@ -282,6 +282,6 @@ class UserImport
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid);
 
                info(L10n::t("Done. You can now login with your username and password"));
-               $a->internalRedirect('login');
+               DI::baseUrl()->redirect('login');
        }
 }
index 577f3da1df7aeacb6071d67e71d3c83b1eed04a3..8d4b8c631270ee91cbfd7c1e06f86a850113049e 100644 (file)
@@ -2272,7 +2272,7 @@ class Contact
                                        $myaddr = bin2hex($a->user['nickname'] . '@' . $a->getHostName());
                                }
 
-                               $a->internalRedirect($ret['request'] . "&addr=$myaddr");
+                               DI::baseUrl()->redirect($ret['request'] . "&addr=$myaddr");
 
                                // NOTREACHED
                        }
index b7c9b68c28a0fd812516e67eebe76ce500b4116d..afca0b150c6ee6e1dc3918c937609a5ae85443e2 100644 (file)
@@ -29,11 +29,11 @@ class Details extends BaseAdminModule
                                        $func($a);
                                }
 
-                               $a->internalRedirect('admin/addons/' . $addon);
+                               DI::baseUrl()->redirect('admin/addons/' . $addon);
                        }
                }
 
-               $a->internalRedirect('admin/addons');
+               DI::baseUrl()->redirect('admin/addons');
        }
 
        public static function content(array $parameters = [])
@@ -51,7 +51,7 @@ class Details extends BaseAdminModule
                        if (!is_file("addon/$addon/$addon.php")) {
                                notice(L10n::t('Addon not found.'));
                                Addon::uninstall($addon);
-                               $a->internalRedirect('admin/addons');
+                               DI::baseUrl()->redirect('admin/addons');
                        }
 
                        if (($_GET['action'] ?? '') == 'toggle') {
@@ -68,7 +68,7 @@ class Details extends BaseAdminModule
 
                                Addon::saveEnabledList();
 
-                               $a->internalRedirect('admin/addons/' . $addon);
+                               DI::baseUrl()->redirect('admin/addons/' . $addon);
                        }
 
                        // display addon details
@@ -119,6 +119,6 @@ class Details extends BaseAdminModule
                        ]);
                }
 
-               $a->internalRedirect('admin/addons');
+               DI::baseUrl()->redirect('admin/addons');
        }
 }
index 237eb7325532da3293bf767f660096c59d446e21..bc28aaa8feb26dcbc7ce10b66924ca9ca997587d 100644 (file)
@@ -41,7 +41,7 @@ class Index extends BaseAdminModule
 
                        }
 
-                       $a->internalRedirect('admin/addons');
+                       DI::baseUrl()->redirect('admin/addons');
                }
 
                $addons = Addon::getAvailableList();
index e21c0ed9592cf973f0a1eb533529678b92e871a1..71e96834b620cf95607f40504c54ec7d4c4084d4 100644 (file)
@@ -39,7 +39,7 @@ class Contact extends BaseAdminModule
                        notice(L10n::tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
                }
 
-               DI::app()->internalRedirect('admin/blocklist/contact');
+               DI::baseUrl()->redirect('admin/blocklist/contact');
        }
 
        public static function content(array $parameters = [])
index 5b84e40653de1b3619a51d24c47532bae20d5a20..87cb8709db426ca9ddffa2ca11bd54401cc1b0ca 100644 (file)
@@ -48,7 +48,7 @@ class Server extends BaseAdminModule
                        info(L10n::t('Site blocklist updated.') . EOL);
                }
 
-               DI::app()->internalRedirect('admin/blocklist/server');
+               DI::baseUrl()->redirect('admin/blocklist/server');
        }
 
        public static function content(array $parameters = [])
index 7aeba4e1b1b26c1df91ff7b4d33321af4b71d797..6f6ebe3d0003ff729127a63f28774c2db0c4456e 100644 (file)
@@ -32,7 +32,7 @@ class DBSync extends BaseAdminModule
                                }
                                info(L10n::t('Update has been marked successful') . EOL);
                        }
-                       $a->internalRedirect('admin/dbsync');
+                       DI::baseUrl()->redirect('admin/dbsync');
                }
 
                if ($a->argc > 2) {
index c9a5a9813d25d1a275966a83bafbd3b60deab9b5..7cc7932af8f0bc3af8e4bd9704a159c97ef08b0f 100644 (file)
@@ -40,7 +40,7 @@ class Features extends BaseAdminModule
                        }
                }
 
-               DI::app()->internalRedirect('admin/features');
+               DI::baseUrl()->redirect('admin/features');
        }
 
        public static function content(array $parameters = [])
index 77849a9aa91c10b6c31db456f1708d159d6a4d38..744a57f07346da29e5611c4ed973c12ee7ab2deb 100644 (file)
@@ -34,7 +34,7 @@ class Delete extends BaseAdminModule
                }
 
                info(L10n::t('Item marked for deletion.') . EOL);
-               DI::app()->internalRedirect('admin/item/delete');
+               DI::baseUrl()->redirect('admin/item/delete');
        }
 
        public static function content(array $parameters = [])
index 0617c1c217568aed23c6e71045018a38f6d79d75..ccddf69a1de4a4873b0044eec81e8e9782d8e044 100644 (file)
@@ -35,7 +35,7 @@ class Settings extends BaseAdminModule
                }
 
                info(L10n::t("Log settings updated."));
-               DI::app()->internalRedirect('admin/logs');
+               DI::baseUrl()->redirect('admin/logs');
        }
 
        public static function content(array $parameters = [])
index abf9d95edba13fb5790d701d0e0ca65f38452236..42b35edff30e76cc28f4828972cd99ad82ef9fb4 100644 (file)
@@ -48,7 +48,7 @@ class Site extends BaseAdminModule
                        $parsed = @parse_url($new_url);
                        if (!is_array($parsed) || empty($parsed['host']) || empty($parsed['scheme'])) {
                                notice(L10n::t("Can not parse base url. Must have at least <scheme>://<domain>"));
-                               $a->internalRedirect('admin/site');
+                               DI::baseUrl()->redirect('admin/site');
                        }
 
                        /* steps:
@@ -77,7 +77,7 @@ class Site extends BaseAdminModule
                                $r = DBA::e(sprintf("UPDATE %s SET %s;", $table_name, $upds));
                                if (!DBA::isResult($r)) {
                                        notice("Failed updating '$table_name': " . DBA::errorMessage());
-                                       $a->internalRedirect('admin/site');
+                                       DI::baseUrl()->redirect('admin/site');
                                }
                        }
 
@@ -105,7 +105,7 @@ class Site extends BaseAdminModule
 
                        info("Relocation started. Could take a while to complete.");
 
-                       $a->internalRedirect('admin/site');
+                       DI::baseUrl()->redirect('admin/site');
                }
                // end relocate
 
@@ -229,7 +229,7 @@ class Site extends BaseAdminModule
                                        foreach ($storage_form_errors as $name => $err) {
                                                notice('Storage backend, ' . $storage_opts[$name][1] . ': ' . $err);
                                        }
-                                       $a->internalRedirect('admin/site' . $active_panel);
+                                       DI::baseUrl()->redirect('admin/site' . $active_panel);
                                }
                        } else {
                                info(L10n::t('Invalid storage backend setting value.'));
@@ -410,7 +410,7 @@ class Site extends BaseAdminModule
 
                info(L10n::t('Site settings updated.') . EOL);
 
-               $a->internalRedirect('admin/site' . $active_panel);
+               DI::baseUrl()->redirect('admin/site' . $active_panel);
        }
 
        public static function content(array $parameters = [])
index 0e9fa08f529143fad6fdd4d8299dc000da47c188..c45204e98a278c98b232fc84f5035abf98e748d7 100644 (file)
@@ -36,7 +36,7 @@ class Details extends BaseAdminModule
                                return;
                        }
 
-                       $a->internalRedirect('admin/themes/' . $theme);
+                       DI::baseUrl()->redirect('admin/themes/' . $theme);
                }
        }
 
@@ -76,7 +76,7 @@ class Details extends BaseAdminModule
                                        info(L10n::t('Theme %s failed to install.', $theme));
                                }
 
-                               $a->internalRedirect('admin/themes/' . $theme);
+                               DI::baseUrl()->redirect('admin/themes/' . $theme);
                        }
 
                        $readme = null;
@@ -122,6 +122,6 @@ class Details extends BaseAdminModule
                        ]);
                }
 
-               $a->internalRedirect('admin/themes');
+               DI::baseUrl()->redirect('admin/themes');
        }
 }
index 8a7b5c19ea27958a90a13bac6179b8c44dc2f686..0ef72773d29012c54b7f6c73475e7cce73b769b1 100644 (file)
@@ -50,7 +50,7 @@ class Embed extends BaseAdminModule
                                return;
                        }
 
-                       $a->internalRedirect('admin/themes/' . $theme . '/embed?mode=minimal');
+                       DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
                }
        }
 
index db6c4bc60b84372e21408f7f30af74135a41a310..63b3d6f39ef6a03a4cf6ffd30708c03df0bc01b0 100644 (file)
@@ -59,7 +59,7 @@ class Index extends BaseAdminModule
 
                        }
 
-                       $a->internalRedirect('admin/themes');
+                       DI::baseUrl()->redirect('admin/themes');
                }
 
                $themes = [];
index 5c7d592253132a2b2f28cedf5acd74dc3af9efe0..5e434bc0d04a5ed98a54fe4115637d84bf6c81b9 100644 (file)
@@ -30,7 +30,7 @@ class Tos extends BaseAdminModule
 
                info(L10n::t('The Terms of Service settings have been updated.'));
 
-               DI::app()->internalRedirect('admin/tos');
+               DI::baseUrl()->redirect('admin/tos');
        }
 
        public static function content(array $parameters = [])
index e6162ae8581f2b84a99b2ccc0d893715a04cb9a4..7d8574e56b62824570094c85b061ff50ffdc30dd 100644 (file)
@@ -129,7 +129,7 @@ class Users extends BaseAdminModule
                        }
                }
 
-               $a->internalRedirect('admin/users');
+               DI::baseUrl()->redirect('admin/users');
        }
 
        public static function content(array $parameters = [])
@@ -145,7 +145,7 @@ class Users extends BaseAdminModule
                        $user = User::getById($uid, ['username', 'blocked']);
                        if (!DBA::isResult($user)) {
                                notice('User not found' . EOL);
-                               $a->internalRedirect('admin/users');
+                               DI::baseUrl()->redirect('admin/users');
                                return ''; // NOTREACHED
                        }
 
@@ -175,7 +175,7 @@ class Users extends BaseAdminModule
                                        break;
                        }
 
-                       $a->internalRedirect('admin/users');
+                       DI::baseUrl()->redirect('admin/users');
                }
 
                /* get pending */
index be0b60f6e1175d6a462f0bf1fd161484e99f5c4f..d7cd0fc72e28b873f74b750756d5294d89f28d07 100644 (file)
@@ -18,7 +18,7 @@ class Apps extends BaseModule
        {
                $privateaddons = Config::get('config', 'private_addons');
                if ($privateaddons === "1" && !local_user()) {
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
        }
 
index 08db0a98c420fe1f0c7dbc50156baf28395c5341..3a5cde24c8fd8a4a9ba8b950940a1e86d242990f 100644 (file)
@@ -56,7 +56,7 @@ abstract class BaseAdminModule extends BaseModule
                if (!is_site_admin()) {
                        notice(L10n::t('Please login to continue.'));
                        Session::set('return_path', $a->query_string);
-                       $a->internalRedirect('login');
+                       DI::baseUrl()->redirect('login');
                }
 
                if (!empty($_SESSION['submanage'])) {
index d366eaf0bd2df4388ad96d1ca832901a2d268b1b..45e4900ac2ee8227f549edd8bdca8d76def3199f 100644 (file)
@@ -22,7 +22,6 @@ use Friendica\Model;
 use Friendica\Module\Security\Login;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Network\HTTPException\NotFoundException;
-use Friendica\Network\Probe;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Proxy as ProxyUtils;
 use Friendica\Util\Strings;
@@ -34,7 +33,7 @@ use Friendica\Util\Strings;
  */
 class Contact extends BaseModule
 {
-       private static function batchActions(App $a)
+       private static function batchActions()
        {
                if (empty($_POST['contact_batch']) || !is_array($_POST['contact_batch'])) {
                        return;
@@ -74,7 +73,7 @@ class Contact extends BaseModule
                        info(L10n::tt('%d contact edited.', '%d contacts edited.', $count_actions));
                }
 
-               $a->internalRedirect('contact');
+               DI::baseUrl()->redirect('contact');
        }
 
        public static function post(array $parameters = [])
@@ -87,7 +86,7 @@ class Contact extends BaseModule
 
                // @TODO: Replace with parameter from router
                if ($a->argv[1] === 'batch') {
-                       self::batchActions($a);
+                       self::batchActions();
                        return;
                }
 
@@ -99,7 +98,7 @@ class Contact extends BaseModule
 
                if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user(), 'deleted' => false])) {
                        notice(L10n::t('Could not access contact record.') . EOL);
-                       $a->internalRedirect('contact');
+                       DI::baseUrl()->redirect('contact');
                        return; // NOTREACHED
                }
 
@@ -280,9 +279,9 @@ class Contact extends BaseModule
                        if ($contact['self']) {
                                // @TODO: Replace with parameter from router
                                if (($a->argc == 3) && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])) {
-                                       $a->internalRedirect('profile/' . $contact['nick']);
+                                       DI::baseUrl()->redirect('profile/' . $contact['nick']);
                                } else {
-                                       $a->internalRedirect('profile/' . $contact['nick'] . '?tab=profile');
+                                       DI::baseUrl()->redirect('profile/' . $contact['nick'] . '?tab=profile');
                                }
                        }
 
@@ -380,13 +379,13 @@ class Contact extends BaseModule
 
                        if ($cmd === 'update' && ($orig_record['uid'] != 0)) {
                                self::updateContactFromPoll($contact_id);
-                               $a->internalRedirect('contact/' . $contact_id);
+                               DI::baseUrl()->redirect('contact/' . $contact_id);
                                // NOTREACHED
                        }
 
                        if ($cmd === 'updateprofile' && ($orig_record['uid'] != 0)) {
                                self::updateContactFromProbe($contact_id);
-                               $a->internalRedirect('crepair/' . $contact_id);
+                               DI::baseUrl()->redirect('crepair/' . $contact_id);
                                // NOTREACHED
                        }
 
@@ -396,7 +395,7 @@ class Contact extends BaseModule
                                $blocked = Model\Contact::isBlockedByUser($contact_id, local_user());
                                info(($blocked ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
 
-                               $a->internalRedirect('contact/' . $contact_id);
+                               DI::baseUrl()->redirect('contact/' . $contact_id);
                                // NOTREACHED
                        }
 
@@ -406,7 +405,7 @@ class Contact extends BaseModule
                                $ignored = Model\Contact::isIgnoredByUser($contact_id, local_user());
                                info(($ignored ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
 
-                               $a->internalRedirect('contact/' . $contact_id);
+                               DI::baseUrl()->redirect('contact/' . $contact_id);
                                // NOTREACHED
                        }
 
@@ -417,7 +416,7 @@ class Contact extends BaseModule
                                        info((($archived) ? L10n::t('Contact has been archived') : L10n::t('Contact has been unarchived')) . EOL);
                                }
 
-                               $a->internalRedirect('contact/' . $contact_id);
+                               DI::baseUrl()->redirect('contact/' . $contact_id);
                                // NOTREACHED
                        }
 
@@ -451,13 +450,13 @@ class Contact extends BaseModule
                                }
                                // Now check how the user responded to the confirmation query
                                if (!empty($_REQUEST['canceled'])) {
-                                       $a->internalRedirect('contact');
+                                       DI::baseUrl()->redirect('contact');
                                }
 
                                self::dropContact($orig_record);
                                info(L10n::t('Contact has been removed.') . EOL);
 
-                               $a->internalRedirect('contact');
+                               DI::baseUrl()->redirect('contact');
                                // NOTREACHED
                        }
                        if ($cmd === 'posts') {
index 48601d6bb3a3f1821142037cbb38d33a8b40af82..9a48d743c893d546ecbe415254e45596d239cb0d 100644 (file)
@@ -19,7 +19,7 @@ class Feed extends BaseModule
        {
                if (!local_user()) {
                        info(L10n::t('You must be logged in to use this module'));
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
        }
 
index 32d02a00e96e82497cc7659bb5d8c5071c1ad890..cb2f24ce1e3f84d9166abf292799e1424809a4f9 100644 (file)
@@ -89,7 +89,7 @@ class Delegation extends BaseModule
                $ret = [];
                Hook::callAll('home_init', $ret);
 
-               DI::app()->internalRedirect('profile/' . DI::app()->user['nickname']);
+               DI::baseUrl()->redirect('profile/' . DI::app()->user['nickname']);
                // NOTREACHED
        }
 
index 5ecaf4c2f9cdda530aa5fe711811bf44f3222427..dfe548d817ea8d9e2ee27c50e9feed9126c327e0 100644 (file)
@@ -47,6 +47,6 @@ class RemoveTag extends BaseModule
                        info('Item was not deleted');
                }
 
-               $app->internalRedirect('network?file=' . rawurlencode($term));
+               DI::baseUrl()->redirect('network?file=' . rawurlencode($term));
        }
 }
index 9c0709db908ca4e62da3f90dcbcd1924162cdedc..93f683744e3505bbe989467520798bb81f34a690 100644 (file)
@@ -19,7 +19,7 @@ class SaveTag extends BaseModule
        {
                if (!local_user()) {
                        info(L10n::t('You must be logged in to use this module'));
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
        }
 
index a19f12737610233ea9a4967da557142f71d23c42..b97b00944c3311e2f5848ed522fd55c6278eadad 100644 (file)
@@ -13,8 +13,6 @@ class FollowConfirm extends BaseModule
 {
        public static function post(array $parameters = [])
        {
-               $a = DI::app();
-
                $uid = local_user();
                if (!$uid) {
                        notice(L10n::t('Permission denied.') . EOL);
@@ -33,6 +31,6 @@ class FollowConfirm extends BaseModule
 
                $Intro->confirm($duplex, $hidden);
 
-               $a->internalRedirect('contact/' . intval($cid));
+               DI::baseUrl()->redirect('contact/' . intval($cid));
        }
 }
index e7e197898686fc9cf71cfde73d6f4a2acb8771ce..b3fe1ba53b04751948329f21921d48c1d3be689b 100644 (file)
@@ -30,7 +30,7 @@ class Group extends BaseModule
 
                if (!local_user()) {
                        notice(L10n::t('Permission denied.'));
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                // @TODO: Replace with parameter from router
@@ -43,12 +43,12 @@ class Group extends BaseModule
                                info(L10n::t('Group created.'));
                                $r = Model\Group::getIdByName(local_user(), $name);
                                if ($r) {
-                                       $a->internalRedirect('group/' . $r);
+                                       DI::baseUrl()->redirect('group/' . $r);
                                }
                        } else {
                                notice(L10n::t('Could not create group.'));
                        }
-                       $a->internalRedirect('group');
+                       DI::baseUrl()->redirect('group');
                }
 
                // @TODO: Replace with parameter from router
@@ -58,7 +58,7 @@ class Group extends BaseModule
                        $group = DBA::selectFirst('group', ['id', 'name'], ['id' => $a->argv[1], 'uid' => local_user()]);
                        if (!DBA::isResult($group)) {
                                notice(L10n::t('Group not found.'));
-                               $a->internalRedirect('contact');
+                               DI::baseUrl()->redirect('contact');
                        }
                        $groupname = Strings::escapeTags(trim($_POST['groupname']));
                        if (strlen($groupname) && ($groupname != $group['name'])) {
@@ -142,7 +142,7 @@ class Group extends BaseModule
                // With no group number provided we jump to the unassigned contacts as a starting point
                // @TODO: Replace with parameter from router
                if ($a->argc == 1) {
-                       $a->internalRedirect('group/none');
+                       DI::baseUrl()->redirect('group/none');
                }
 
                // Switch to text mode interface if we have more than 'n' contacts or group members
@@ -200,7 +200,7 @@ class Group extends BaseModule
                        if (intval($a->argv[2])) {
                                if (!Model\Group::exists($a->argv[2], local_user())) {
                                        notice(L10n::t('Group not found.'));
-                                       $a->internalRedirect('contact');
+                                       DI::baseUrl()->redirect('contact');
                                }
 
                                if (Model\Group::remove($a->argv[2])) {
@@ -209,7 +209,7 @@ class Group extends BaseModule
                                        notice(L10n::t('Unable to remove group.'));
                                }
                        }
-                       $a->internalRedirect('group');
+                       DI::baseUrl()->redirect('group');
                }
 
                // @TODO: Replace with parameter from router
@@ -226,7 +226,7 @@ class Group extends BaseModule
                        $group = DBA::selectFirst('group', ['id', 'name'], ['id' => $a->argv[1], 'uid' => local_user(), 'deleted' => false]);
                        if (!DBA::isResult($group)) {
                                notice(L10n::t('Group not found.'));
-                               $a->internalRedirect('contact');
+                               DI::baseUrl()->redirect('contact');
                        }
 
                        $members = Model\Contact::getByGroupId($group['id']);
index f5032f7c30ddaecd93b5a048bccef357eb23b733..fc8817b31b6846d507096bd8775aced5a9d31501 100644 (file)
@@ -25,11 +25,11 @@ class Home extends BaseModule
                Hook::callAll('home_init', $ret);
 
                if (local_user() && ($app->user['nickname'])) {
-                       $app->internalRedirect('network');
+                       DI::baseUrl()->redirect('network');
                }
 
                if (strlen($config->get('system', 'singleuser'))) {
-                       $app->internalRedirect('/profile/' . $config->get('system', 'singleuser'));
+                       DI::baseUrl()->redirect('/profile/' . $config->get('system', 'singleuser'));
                }
 
                $customHome = '';
index f59ba229c172096ef7adabc75d4c74939c007beb..b20074166539e2ced763f1ad82318f0391ce8acc 100644 (file)
@@ -67,7 +67,7 @@ class Ignore extends BaseModule
                                $rand = "?$rand";
                        }
 
-                       DI::app()->internalRedirect($return_path . $rand);
+                       DI::baseUrl()->redirect($return_path . $rand);
                }
 
                // the json doesn't really matter, it will either be 0 or 1
index 74a0b8d8594eb487c79b22614353efe054268936..2c5f02b1f62906b9d6a832e5fe76ba1f1f4b95e5 100644 (file)
@@ -47,7 +47,7 @@ class Like extends BaseModule
                                $rand = "?$rand";
                        }
 
-                       $app->internalRedirect($returnPath . $rand);
+                       DI::baseUrl()->redirect($returnPath . $rand);
                }
        }
 }
index 5200c59114e5d8d22ea70b0176c9dcde8505ef13..bb52ce8124faca9315019bd0f0720cfa4678889d 100644 (file)
@@ -58,10 +58,10 @@ class Notify extends BaseModule
                                }
                        }
 
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                // @TODO: Replace with parameter from router
-               $a->internalRedirect('notifications/system');
+               DI::baseUrl()->redirect('notifications/system');
        }
 }
index 4817811a34eb571fca77190c77c9d58b92794b4b..4113a545d595d10e3dad1729d8569928fff1c12d 100644 (file)
@@ -25,7 +25,7 @@ class Objects extends BaseModule
                }
 
                if (!ActivityPub::isRequest()) {
-                       $a->internalRedirect(str_replace('objects/', 'display/', $a->query_string));
+                       DI::baseUrl()->redirect(str_replace('objects/', 'display/', $a->query_string));
                }
 
                /// @todo Add Authentication to enable fetching of non public content
index 1bd25f2722caf59a093b8c3d92551405aeb44aeb..b28777516ef0fcacb8cb624c900ca61edaf96ae3 100644 (file)
@@ -31,7 +31,7 @@ class Pinned extends BaseModule
                $returnPath = $_REQUEST['return'] ?? '';
                if (!empty($returnPath)) {
                        $rand = '_=' . time() . (strpos($returnPath, '?') ? '&' : '?') . 'rand';
-                       DI::app()->internalRedirect($returnPath . $rand);
+                       DI::baseUrl()->redirect($returnPath . $rand);
                }
 
                // the json doesn't really matter, it will either be 0 or 1
index f595ae98ed46ae96bcfabf1a066226f8b22541b6..c14e9f6cacbe5af7286205d484c1a91e6442e832 100644 (file)
@@ -23,6 +23,6 @@ class RandomProfile extends BaseModule
                        $a->redirect($link);
                }
 
-               $a->internalRedirect('profile');
+               DI::baseUrl()->redirect('profile');
        }
 }
index 9a6df2f634ee113ecd65f148a1d4df526cd66e60..2c9b00bf0caa090773f6b91590ecce52e4691f6f 100644 (file)
@@ -238,7 +238,7 @@ class Register extends BaseModule
 
                                if ($res) {
                                        \info(L10n::t('Registration successful. Please check your email for further instructions.') . EOL);
-                                       $a->internalRedirect();
+                                       DI::baseUrl()->redirect();
                                } else {
                                        \notice(
                                                L10n::t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
@@ -248,12 +248,12 @@ class Register extends BaseModule
                                }
                        } else {
                                \info(L10n::t('Registration successful.') . EOL);
-                               $a->internalRedirect();
+                               DI::baseUrl()->redirect();
                        }
                } elseif (intval(Config::get('config', 'register_policy')) === self::APPROVE) {
                        if (!strlen(Config::get('config', 'admin_email'))) {
                                \notice(L10n::t('Your registration can not be processed.') . EOL);
-                               $a->internalRedirect();
+                               DI::baseUrl()->redirect();
                        }
 
                        // Check if the note to the admin is actually filled out
@@ -261,12 +261,12 @@ class Register extends BaseModule
                                \notice(L10n::t('You have to leave a request note for the admin.')
                                        . L10n::t('Your registration can not be processed.') . EOL);
 
-                               $a->internalRedirect('register/');
+                               DI::baseUrl()->redirect('register/');
                        }
                        // Is there text in the tar pit?
                        if (!empty($_POST['registertarpit'])) {
                                \notice(L10n::t('You have entered too much information.'));
-                               $a->internalRedirect('register/');
+                               DI::baseUrl()->redirect('register/');
                        }
 
                        Model\Register::createForApproval($user['uid'], Config::get('system', 'language'), $_POST['permonlybox']);
@@ -312,7 +312,7 @@ class Register extends BaseModule
                        );
 
                        \info(L10n::t('Your registration is pending approval by the site owner.') . EOL);
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                return;
index c2d60bc5a3eb34043e3791de900164778adfc350..47925b0ae1348426db08401a4224bc0d84f6fae5 100644 (file)
@@ -36,6 +36,6 @@ class Saved extends BaseModule
                        }
                }
 
-               DI::app()->internalRedirect($return_url);
+               DI::baseUrl()->redirect($return_url);
        }
 }
index a049abc882fa3ac92a92f7c58a1ebd59123492c1..c5257789855a1fc255f19e5d9956f97be5c66928 100644 (file)
@@ -25,10 +25,8 @@ class Login extends BaseModule
 {
        public static function content(array $parameters = [])
        {
-               $a = DI::app();
-
                if (local_user()) {
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
index c0a07610872febb2b4ecda9868f062e127e96ac9..abe409ca1d3aa4c9f87a234e8c1852f794f9274a 100644 (file)
@@ -40,7 +40,7 @@ class Logout extends BaseModule
                        System::externalRedirect($visitor_home);
                } else {
                        info(L10n::t('Logged out.'));
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
        }
 }
index 9a6beb13ad72a6bf2ed3b3f0c0c4efb4422f2daf..bbbb2d44514dbe38635ab81b486749d2bf267007 100644 (file)
@@ -52,12 +52,12 @@ class Recovery extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                // Already authenticated with 2FA token
                if (Session::get('2fa')) {
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [
index ff494d7ca0b6c1e7474ead0ff95d2333508251ac..8fc647472d7a5eed1b5fa490defad7930895d3ec 100644 (file)
@@ -50,12 +50,12 @@ class Verify extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                // Already authenticated with 2FA token
                if (Session::get('2fa')) {
-                       DI::app()->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
 
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/verify.tpl'), [
index 43d485746358d05be7b6077b587f06db698ac1c1..988487656623043cea8827bf1dc3c4f2ee0463eb 100644 (file)
@@ -64,7 +64,7 @@ class Delegation extends BaseSettingsModule
                if ($action === 'add' && $user_id) {
                        if (Session::get('submanage')) {
                                notice(L10n::t('Delegated administrators can view but not change delegation permissions.'));
-                               DI::app()->internalRedirect('settings/delegation');
+                               DI::baseUrl()->redirect('settings/delegation');
                        }
 
                        $user = User::getById($user_id, ['nickname']);
@@ -80,17 +80,17 @@ class Delegation extends BaseSettingsModule
                                notice(L10n::t('Delegate user not found.'));
                        }
 
-                       DI::app()->internalRedirect('settings/delegation');
+                       DI::baseUrl()->redirect('settings/delegation');
                }
 
                if ($action === 'remove' && $user_id) {
                        if (Session::get('submanage')) {
                                notice(L10n::t('Delegated administrators can view but not change delegation permissions.'));
-                               DI::app()->internalRedirect('settings/delegation');
+                               DI::baseUrl()->redirect('settings/delegation');
                        }
 
                        DBA::delete('manage', ['uid' => $user_id, 'mid' => local_user()]);
-                       DI::app()->internalRedirect('settings/delegation');
+                       DI::baseUrl()->redirect('settings/delegation');
                }
 
                // find everybody that currently has delegated management to this account/page
index 1823b56f0d59e2d0d1d962c13c80ea2e90867dce..a3038627123ab2152a6d08ae1faee8151e57c77c 100644 (file)
@@ -30,12 +30,12 @@ class AppSpecific extends BaseSettingsModule
                $verified = PConfig::get(local_user(), '2fa', 'verified');
 
                if (!$verified) {
-                       DI::app()->internalRedirect('settings/2fa');
+                       DI::baseUrl()->redirect('settings/2fa');
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
                        notice(L10n::t('Please enter your password to access this page.'));
-                       DI::app()->internalRedirect('settings/2fa');
+                       DI::baseUrl()->redirect('settings/2fa');
                }
        }
 
@@ -53,10 +53,10 @@ class AppSpecific extends BaseSettingsModule
                                        $description = $_POST['description'] ?? '';
                                        if (empty($description)) {
                                                notice(L10n::t('App-specific password generation failed: The description is empty.'));
-                                               DI::app()->internalRedirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                               DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        } elseif (AppSpecificPassword::checkDuplicateForUser(local_user(), $description)) {
                                                notice(L10n::t('App-specific password generation failed: This description already exists.'));
-                                               DI::app()->internalRedirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                               DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        } else {
                                                self::$appSpecificPassword = AppSpecificPassword::generateForUser(local_user(), $_POST['description'] ?? '');
                                                notice(L10n::t('New app-specific password generated.'));
@@ -66,7 +66,7 @@ class AppSpecific extends BaseSettingsModule
                                case 'revoke_all' :
                                        AppSpecificPassword::deleteAllForUser(local_user());
                                        notice(L10n::t('App-specific passwords successfully revoked.'));
-                                       DI::app()->internalRedirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                       DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        break;
                        }
                }
@@ -78,7 +78,7 @@ class AppSpecific extends BaseSettingsModule
                                notice(L10n::t('App-specific password successfully revoked.'));
                        }
 
-                       DI::app()->internalRedirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                       DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                }
        }
 
index 9e822e89eed2cac83b64b9a65a816c99d5333498..06e0e66d515017b659309fd68b3f8cc1d28b2fe2 100644 (file)
@@ -39,7 +39,7 @@ class Index extends BaseSettingsModule
 
                                                PConfig::set(local_user(), '2fa', 'secret', $Google2FA->generateSecretKey(32));
 
-                                               DI::app()->internalRedirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                               DI::baseUrl()->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        }
                                        break;
                                case 'disable':
@@ -50,22 +50,22 @@ class Index extends BaseSettingsModule
                                                Session::remove('2fa');
 
                                                notice(L10n::t('Two-factor authentication successfully disabled.'));
-                                               DI::app()->internalRedirect('settings/2fa');
+                                               DI::baseUrl()->redirect('settings/2fa');
                                        }
                                        break;
                                case 'recovery':
                                        if ($has_secret) {
-                                               DI::app()->internalRedirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                               DI::baseUrl()->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        }
                                        break;
                                case 'app_specific':
                                        if ($has_secret) {
-                                               DI::app()->internalRedirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                               DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        }
                                        break;
                                case 'configure':
                                        if (!$verified) {
-                                               DI::app()->internalRedirect('settings/2fa/verify?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                               DI::baseUrl()->redirect('settings/2fa/verify?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        }
                                        break;
                        }
index 28f839644c9e5721c0054136a89d3a33b86d9cb8..492b96635bdf5471378cd72216d7a1801370367c 100644 (file)
@@ -28,12 +28,12 @@ class Recovery extends BaseSettingsModule
                $secret = PConfig::get(local_user(), '2fa', 'secret');
 
                if (!$secret) {
-                       DI::app()->internalRedirect('settings/2fa');
+                       DI::baseUrl()->redirect('settings/2fa');
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
                        notice(L10n::t('Please enter your password to access this page.'));
-                       DI::app()->internalRedirect('settings/2fa');
+                       DI::baseUrl()->redirect('settings/2fa');
                }
        }
 
@@ -49,7 +49,7 @@ class Recovery extends BaseSettingsModule
                        if ($_POST['action'] == 'regenerate') {
                                RecoveryCode::regenerateForUser(local_user());
                                notice(L10n::t('New recovery codes successfully generated.'));
-                               DI::app()->internalRedirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                               DI::baseUrl()->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
                        }
                }
        }
index b4786326204d78050dbeae49e607e24fa1817818..96feab825ae1602844c354475c8d9c8605e0045f 100644 (file)
@@ -35,12 +35,12 @@ class Verify extends BaseSettingsModule
                $verified = PConfig::get(local_user(), '2fa', 'verified');
 
                if ($secret && $verified) {
-                       DI::app()->internalRedirect('settings/2fa');
+                       DI::baseUrl()->redirect('settings/2fa');
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
                        notice(L10n::t('Please enter your password to access this page.'));
-                       DI::app()->internalRedirect('settings/2fa');
+                       DI::baseUrl()->redirect('settings/2fa');
                }
        }
 
@@ -63,7 +63,7 @@ class Verify extends BaseSettingsModule
 
                                notice(L10n::t('Two-factor authentication successfully activated.'));
 
-                               DI::app()->internalRedirect('settings/2fa');
+                               DI::baseUrl()->redirect('settings/2fa');
                        } else {
                                notice(L10n::t('Invalid code, please retry.'));
                        }
index d6ec19ea732dcaebc93e680d22e1d2e0995748be..0f111b21e0198f51185aef8b650044d37837bd0d 100644 (file)
@@ -36,7 +36,7 @@ class Starred extends BaseModule
                $returnPath = $_REQUEST['return'] ?? '';
                if (!empty($returnPath)) {
                        $rand = '_=' . time() . (strpos($returnPath, '?') ? '&' : '?') . 'rand';
-                       DI::app()->internalRedirect($returnPath . $rand);
+                       DI::baseUrl()->redirect($returnPath . $rand);
                }
 
                // the json doesn't really matter, it will either be 0 or 1
index 7adce79174183f5c06620b2b3a232833da2e0258..b28c98de7b35e55a7b7bc15cb567affedaf8dcd0 100644 (file)
@@ -51,7 +51,7 @@ class Tos extends BaseModule
        public static function init(array $parameters = [])
        {
                if (strlen(Config::get('system','singleuser'))) {
-                       DI::app()->internalRedirect('profile/' . Config::get('system','singleuser'));
+                       DI::baseUrl()->redirect('profile/' . Config::get('system','singleuser'));
                }
        }