]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Added tags+private in shaarli URL
authorSébastien SAUVAGE <sebsauvage@sebsauvage.net>
Tue, 24 Sep 2013 09:17:22 +0000 (11:17 +0200)
committerSébastien SAUVAGE <sebsauvage@sebsauvage.net>
Tue, 24 Sep 2013 09:17:22 +0000 (11:17 +0200)
Manually merged pull request https://github.com/sebsauvage/Shaarli/pull/99

index.php

index 9446c660a044c2a6199ed03a5efae13622c9c8d0..327109f06a89275f75f1f62660e952460ac9f6b2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1541,7 +1541,8 @@ function renderPage()
             $linkdate = strval(date('Ymd_His'));
             $title = (empty($_GET['title']) ? '' : $_GET['title'] ); // Get title if it was provided in URL (by the bookmarklet).
             $description = (empty($_GET['description']) ? '' : $_GET['description'] )."\n"; // Get description if it was provided in URL (by the bookmarklet). [Bronco added that]
-            $tags=''; $private=0;
+            $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); // Get tags if it was provided in URL
+            $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL 
             if (($url!='') && parse_url($url,PHP_URL_SCHEME)=='') $url = 'http://'.$url;
             // If this is an HTTP link, we try go get the page to extact the title (otherwise we will to straight to the edit form.)
             if (empty($title) && parse_url($url,PHP_URL_SCHEME)=='http')
@@ -1573,7 +1574,7 @@ function renderPage()
                                        }
             }
             if ($url=='') $url='?'.smallHash($linkdate); // In case of empty URL, this is just a text (with a link that point to itself)
-            $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>0);
+            $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>$private);
         }
 
         $PAGE = new pageBuilder;