]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fixes #382: Bookmarklet can not retrieve title when there is a quotation mark in it 387/head
authorArthurHoaro <arthur@hoa.ro>
Sun, 22 Nov 2015 14:47:41 +0000 (15:47 +0100)
committerArthurHoaro <arthur@hoa.ro>
Sun, 22 Nov 2015 14:47:41 +0000 (15:47 +0100)
    bookmarklet fields weren't correctly escaped

index.php

index 872acf098e9ec9f0b9e5ba9a4ffa0d980cdb50d5..8f0bd4b92df1f761a1973f7bc435834c254dbb92 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1611,11 +1611,11 @@ function renderPage()
             $link_is_new = true;
             $linkdate = strval(date('Ymd_His'));
             // Get title if it was provided in URL (by the bookmarklet).
-            $title = (empty($_GET['title']) ? '' : $_GET['title'] );
+            $title = empty($_GET['title']) ? '' : escape($_GET['title']);
             // Get description if it was provided in URL (by the bookmarklet). [Bronco added that]
-            $description = (empty($_GET['description']) ? '' : $_GET['description']);
-            $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] );
-            $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0);
+            $description = empty($_GET['description']) ? '' : escape($_GET['description']);
+            $tags = empty($_GET['tags']) ? '' : escape($_GET['tags']);
+            $private = !empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0;
             // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.)
             if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) {
                 // Short timeout to keep the application responsive