]> git.mxchange.org Git - friendica.git/blobdiff - mod/bookmarklet.php
Issue 6296 - and again templates
[friendica.git] / mod / bookmarklet.php
index 21b2039c5891c97260aae78c34a91c8a84716540..d9c2f52f821d0a449c7a24b116fd0f36358ae4dd 100644 (file)
@@ -9,6 +9,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Module\Login;
+use Friendica\Util\Strings;
 
 require_once 'include/conversation.php';
 require_once 'include/items.php';
@@ -26,10 +27,14 @@ function bookmarklet_content(App $a)
                return $o;
        }
 
-       $referer = normalise_link(defaults($_SERVER, 'HTTP_REFERER', ''));
-       $page = normalise_link(System::baseUrl() . "/bookmarklet");
+       $referer = Strings::normaliseLink(defaults($_SERVER, 'HTTP_REFERER', ''));
+       $page = Strings::normaliseLink(System::baseUrl() . "/bookmarklet");
 
        if (!strstr($referer, $page)) {
+               if (empty($_REQUEST["url"])) {
+                       System::httpExit(400, ["title" => L10n::t('Bad Request')]);
+               }
+
                $content = add_page_info($_REQUEST["url"]);
 
                $x = [