From 9866b40814a120f1a019f9f2c8ef66f44e1ddfcb Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 2 Aug 2016 10:34:21 +0200 Subject: Better whitespace handling in tags Correct PR #573 to work properly with hidden tags, and add ReferenceLinkDB UT. Fixes #571 - Closes #573 --- application/LinkDB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/LinkDB.php') diff --git a/application/LinkDB.php b/application/LinkDB.php index e9d216ea..d80434bf 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -291,7 +291,7 @@ You use the community supported version of the original Shaarli project, by Seba // Remove private tags if the user is not logged in. if (! $this->_loggedIn) { - $link['tags'] = preg_replace('/(^|\s*)\.[^($| )]+\s*$/', '', $link['tags']); + $link['tags'] = preg_replace('/(^|\s+)\.[^($|\s)]+\s*/', ' ', $link['tags']); } // Do not use the redirector for internal links (Shaarli note URL starting with a '?'). -- cgit v1.2.3