]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #940 from ArthurHoaro/hotfix/empty-urls
authorVirtualTam <virtualtam+github@flibidi.net>
Sun, 27 Aug 2017 11:15:43 +0000 (13:15 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Aug 2017 11:15:43 +0000 (13:15 +0200)
Generates a permalink URL if the URL is set to blank

index.php

index c9bbfce5ac8587076f66d926ebe8ae6a7a512756..7df6d819ef4edc12ad95e66e659c21897beb88e3 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1248,6 +1248,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
         // Remove duplicates.
         $tags = implode(' ', array_unique(explode(' ', $tags)));
 
+        if (empty(trim($_POST['lf_url']))) {
+            $_POST['lf_url'] = '?' . smallHash($linkdate . $id);
+        }
         $url = whitelist_protocols(trim($_POST['lf_url']), $conf->get('security.allowed_protocols'));
 
         $link = array(