]> git.mxchange.org Git - friendica.git/commitdiff
Fix redirect calls using DI::baseUrl() and System::externalRedirect
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 30 Dec 2019 02:50:51 +0000 (21:50 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 30 Dec 2019 02:50:51 +0000 (21:50 -0500)
mod/message.php
mod/redir.php

index 4c6aa3d84823eb6fe9f544f8999a3419e5985884..f10ff76b92266a3039b0a4ffa2498abdaedd9e7d 100644 (file)
@@ -178,7 +178,7 @@ function message_content(App $a)
                                DI::baseUrl()->redirect('message');
                        }
 
-                       DI::baseUrl()->redirectinternalRedirect('message/' . $conversation['id'] );
+                       DI::baseUrl()->redirect('message/' . $conversation['id'] );
                } else {
                        $r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval($a->argv[2]),
index 6083117b4064a1bbaf72cb9ca38dcd56522a468a..9b4b440bbc9a1ea6e2c2ad1fb1dcd894b4243e7e 100644 (file)
@@ -137,9 +137,9 @@ function redir_magic($a, $cid, $url)
                // Shouldn't happen under normal conditions
                notice(L10n::t('Contact not found.'));
                if (!empty($url)) {
-                       $a->redirect($url);
+                       System::externalRedirect($url);
                } else {
-                       $a->internalRedirect();
+                       DI::baseUrl()->redirect();
                }
        } else {
                $contact_url = $contact['url'];
@@ -151,7 +151,7 @@ function redir_magic($a, $cid, $url)
        // We don't use magic auth when there is no visitor, we are on the same system or we visit our own stuff
        if (empty($visitor) || Strings::compareLink($basepath, System::baseUrl()) || Strings::compareLink($contact_url, $visitor)) {
                Logger::info('Redirecting without magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
-               $a->redirect($target_url);
+               System::externalRedirect($target_url);
        }
 
        // Test for magic auth on the target system
@@ -161,7 +161,7 @@ function redir_magic($a, $cid, $url)
                $target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
 
                Logger::info('Redirecting with magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
-               $a->redirect($target_url);
+               System::externalRedirect($target_url);
        } else {
                Logger::info('No magic for contact', ['contact' => $contact_url]);
        }