From: ArthurHoaro Date: Mon, 15 Feb 2016 20:06:17 +0000 (+0100) Subject: Remove first '-' char when saving tags X-Git-Tag: v0.6.4~12^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=ce354bf1a61ce2478529ad558b24cdf9678c398a;p=github%2Fshaarli%2FShaarli.git Remove first '-' char when saving tags --- diff --git a/index.php b/index.php index 4382bd80..d9fe5bc2 100644 --- 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'];