]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #447 from ArthurHoaro/hidden-tags
[github/shaarli/Shaarli.git] / index.php
index 5de60425c4c8bdadecdad5163918a5491c24d16c..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'];
@@ -1858,7 +1860,7 @@ HTML;
             );
 
             // TODO: do not handle exceptions/errors in JS.
-            echo '<script>alert("'. $e->getMessage() .'");document.location=\'?do=pluginsadmin\';</script>';
+            echo '<script>alert("'. $e->getMessage() .'");document.location=\'?do='. Router::$PAGE_PLUGINSADMIN .'\';</script>';
             exit;
         }
         header('Location: ?do='. Router::$PAGE_PLUGINSADMIN);