]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Remove first '-' char when saving tags 446/head
authorArthurHoaro <arthur@hoa.ro>
Mon, 15 Feb 2016 20:06:17 +0000 (21:06 +0100)
committerArthurHoaro <arthur@hoa.ro>
Mon, 15 Feb 2016 20:06:17 +0000 (21:06 +0100)
index.php

index 4382bd808ff9f035c681b9232a6a76b348bea4cd..d9fe5bc2d9cac9ad917bde90032e9df758ac9444 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1558,6 +1558,8 @@ function renderPage()
         }
         // Remove multiple spaces.
         $tags = trim(preg_replace('/\s\s+/', ' ', $_POST['lf_tags']));
+        // Remove first '-' char in tags.
+        $tags = preg_replace('/(^| )\-/', '$1', $tags);
         // Remove duplicates.
         $tags = implode(' ', array_unique(explode(' ', $tags)));
         $linkdate = $_POST['lf_linkdate'];