diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-18 17:59:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-18 17:59:37 +0100 |
commit | 1001cc108fec759b076c9f6e12b71dea5d49fe9b (patch) | |
tree | d7b57a982129b2006d388c2f9d25d29eceee891a /application/bookmark | |
parent | 12523aea3458504be91854ce2f37d4f5991ccea2 (diff) | |
parent | a39acb2518f272df8a601af72c13eabe2719dcb8 (diff) | |
download | Shaarli-1001cc108fec759b076c9f6e12b71dea5d49fe9b.tar.gz Shaarli-1001cc108fec759b076c9f6e12b71dea5d49fe9b.tar.zst Shaarli-1001cc108fec759b076c9f6e12b71dea5d49fe9b.zip |
Fix an issue with private tags and fix nomarkdown tag (#1399)
Fix an issue with private tags and fix nomarkdown tag
Diffstat (limited to 'application/bookmark')
-rw-r--r-- | application/bookmark/BookmarkFileService.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/application/bookmark/BookmarkFileService.php b/application/bookmark/BookmarkFileService.php index a56cc92b..9c59e139 100644 --- a/application/bookmark/BookmarkFileService.php +++ b/application/bookmark/BookmarkFileService.php | |||
@@ -8,6 +8,7 @@ use Exception; | |||
8 | use Shaarli\Bookmark\Exception\BookmarkNotFoundException; | 8 | use Shaarli\Bookmark\Exception\BookmarkNotFoundException; |
9 | use Shaarli\Bookmark\Exception\EmptyDataStoreException; | 9 | use Shaarli\Bookmark\Exception\EmptyDataStoreException; |
10 | use Shaarli\Config\ConfigManager; | 10 | use Shaarli\Config\ConfigManager; |
11 | use Shaarli\Formatter\BookmarkMarkdownFormatter; | ||
11 | use Shaarli\History; | 12 | use Shaarli\History; |
12 | use Shaarli\Legacy\LegacyLinkDB; | 13 | use Shaarli\Legacy\LegacyLinkDB; |
13 | use Shaarli\Legacy\LegacyUpdater; | 14 | use Shaarli\Legacy\LegacyUpdater; |
@@ -130,7 +131,7 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
130 | } | 131 | } |
131 | 132 | ||
132 | if ($visibility === null) { | 133 | if ($visibility === null) { |
133 | $visibility = $this->isLoggedIn ? 'all' : 'public'; | 134 | $visibility = $this->isLoggedIn ? BookmarkFilter::$ALL : BookmarkFilter::$PUBLIC; |
134 | } | 135 | } |
135 | 136 | ||
136 | $bookmark = $this->bookmarks[$id]; | 137 | $bookmark = $this->bookmarks[$id]; |
@@ -287,9 +288,13 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
287 | $caseMapping = []; | 288 | $caseMapping = []; |
288 | foreach ($bookmarks as $bookmark) { | 289 | foreach ($bookmarks as $bookmark) { |
289 | foreach ($bookmark->getTags() as $tag) { | 290 | foreach ($bookmark->getTags() as $tag) { |
290 | if (empty($tag) || (! $this->isLoggedIn && startsWith($tag, '.'))) { | 291 | if (empty($tag) |
292 | || (! $this->isLoggedIn && startsWith($tag, '.')) | ||
293 | || $tag === BookmarkMarkdownFormatter::NO_MD_TAG | ||
294 | ) { | ||
291 | continue; | 295 | continue; |
292 | } | 296 | } |
297 | |||
293 | // The first case found will be displayed. | 298 | // The first case found will be displayed. |
294 | if (!isset($caseMapping[strtolower($tag)])) { | 299 | if (!isset($caseMapping[strtolower($tag)])) { |
295 | $caseMapping[strtolower($tag)] = $tag; | 300 | $caseMapping[strtolower($tag)] = $tag; |