]> git.mxchange.org Git - friendica.git/commitdiff
Adding $a->getBaseURL for Worker in profile_photo
authorPhilipp Holzer <admin@philipp.info>
Fri, 19 Oct 2018 23:00:01 +0000 (01:00 +0200)
committerPhilipp Holzer <admin@philipp.info>
Mon, 22 Oct 2018 20:13:39 +0000 (22:13 +0200)
Adding a TODO for Contact::magicLink

mod/profile_photo.php
mod/randprof.php
src/Model/Contact.php

index ee4f35f200af6c6286db9e74e2772993ddba9414..19188ba23e884886b5b10ff6a9e6665fc6732ac9 100644 (file)
@@ -126,7 +126,7 @@ function profile_photo_post(App $a)
                                info(L10n::t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
                                // Update global directory in background
                                if ($path && strlen(Config::get('system', 'directory'))) {
-                                       Worker::add(PRIORITY_LOW, "Directory", $path);
+                                       Worker::add(PRIORITY_LOW, "Directory", $a->getBaseURL() . '/' . $path);
                                }
 
                                Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
index 4da149afdc8c177dc11d765659dc6b0a02cdf2a0..055b3dcbe8650b9d86d725085045dea48e78b2ae 100644 (file)
@@ -13,7 +13,13 @@ function randprof_init(App $a)
        $x = GContact::getRandomUrl();
 
        if ($x) {
-               $a->internalRedirect(Contact::magicLink($x));
+               $link = Contact::magicLink($x);
+               // @TODO making the return of magicLink save to use either externalRedirect or internalRedirect
+               if (filter_var($link, FILTER_VALIDATE_URL)) {
+                       System::externalRedirect($link);
+               } else {
+                       $a->internalRedirect($link);
+               }
        }
 
        $a->internalRedirect('profile');
index 343340800d76a212a4917055c7b168551998c92e..1a5c97834ad35e8eed0f2bcf5a30fb242602ddec 100644 (file)
@@ -2024,6 +2024,8 @@ class Contact extends BaseObject
        /**
         * @brief Returns a magic link to authenticate remote visitors
         *
+        * @todo check if the return is either a fully qualified URL or a relative path to Friendica basedir
+        *
         * @param string $contact_url The address of the target contact profile
         * @param string $url An url that we will be redirected to after the authentication
         *