From: VirtualTam Date: Sun, 27 Aug 2017 11:15:43 +0000 (+0200) Subject: Merge pull request #940 from ArthurHoaro/hotfix/empty-urls X-Git-Tag: v0.9.4~7^2~11 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=fc27141cf6eb04d3d8714385cb6961a8063fe61b;hp=e8cef3ac43d5a50485c72ea2e8267e92b00be609;p=github%2Fshaarli%2FShaarli.git Merge pull request #940 from ArthurHoaro/hotfix/empty-urls Generates a permalink URL if the URL is set to blank --- diff --git a/index.php b/index.php index c9bbfce5..7df6d819 100644 --- 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(