]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Bookmarklet.php
Adding and removing of pictures via API is now possible
[friendica.git] / src / Module / Bookmarklet.php
index 3551cfd1756beb5f35ee7ad69f6acf43c8e3d97b..959ed71a8debf2c4cc6b20f0e55069a9043a3381 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -34,20 +34,20 @@ use Friendica\Util\Strings;
  */
 class Bookmarklet extends BaseModule
 {
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                $_GET['mode'] = 'minimal';
 
                $config = DI::config();
 
-               if (!local_user()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        $output = '<h2>' . DI::l10n()->t('Login') . '</h2>';
                        $output .= Login::form(DI::args()->getQueryString(), intval($config->get('config', 'register_policy')) === Register::CLOSED ? false : true);
                        return $output;
                }
 
                $referer = Strings::normaliseLink($_SERVER['HTTP_REFERER'] ?? '');
-               $page = Strings::normaliseLink(DI::baseUrl()->get() . "/bookmarklet");
+               $page = Strings::normaliseLink(DI::baseUrl() . "/bookmarklet");
 
                if (!strstr($referer, $page)) {
                        if (empty($_REQUEST["url"])) {