]> git.mxchange.org Git - friendica.git/blobdiff - mod/bookmarklet.php
Cleanups: isResult() more used, readability improved (#5608)
[friendica.git] / mod / bookmarklet.php
index 9ae3e28f085feb59d59665439dab9e1fb4be5a13..21b2039c5891c97260aae78c34a91c8a84716540 100644 (file)
@@ -5,6 +5,7 @@
 
 use Friendica\App;
 use Friendica\Core\ACL;
+use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Module\Login;
@@ -21,11 +22,11 @@ function bookmarklet_content(App $a)
 {
        if (!local_user()) {
                $o = '<h2>' . L10n::t('Login') . '</h2>';
-               $o .= Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true);
+               $o .= Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? false : true);
                return $o;
        }
 
-       $referer = normalise_link($_SERVER["HTTP_REFERER"]);
+       $referer = normalise_link(defaults($_SERVER, 'HTTP_REFERER', ''));
        $page = normalise_link(System::baseUrl() . "/bookmarklet");
 
        if (!strstr($referer, $page)) {
@@ -42,7 +43,7 @@ function bookmarklet_content(App $a)
                        'bang' => '',
                        'visitor' => 'block',
                        'profile_uid' => local_user(),
-                       'title' => trim($_REQUEST["title"], "*"),
+                       'title' => trim(defaults($_REQUEST, 'title', ''), "*"),
                        'content' => $content
                ];
                $o = status_editor($a, $x, 0, false);