]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Generates a permalinks URL if the URL is set to blank 940/head
authorArthurHoaro <arthur@hoa.ro>
Fri, 25 Aug 2017 18:08:07 +0000 (20:08 +0200)
committerArthurHoaro <arthur@hoa.ro>
Fri, 25 Aug 2017 18:08:07 +0000 (20:08 +0200)
Fixes #926

index.php

index b4c4347a40c46addc904079ae31f36b6b08da707..23c8d473f81e58cd77690fc4ab565005ef295d97 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1256,6 +1256,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(