aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/BookmarkFileService.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-08-29 10:06:40 +0200
committerArthurHoaro <arthur@hoa.ro>2020-08-29 10:06:40 +0200
commita8e210faa624517ee8b8978b7e659a0b3c689297 (patch)
tree68a1d7671210ac39bc556ee6a54cf969ca7a605f /application/bookmark/BookmarkFileService.php
parentbea062149ebcb4663861edb1cc0a32faf85b273f (diff)
downloadShaarli-a8e210faa624517ee8b8978b7e659a0b3c689297.tar.gz
Shaarli-a8e210faa624517ee8b8978b7e659a0b3c689297.tar.zst
Shaarli-a8e210faa624517ee8b8978b7e659a0b3c689297.zip
Fixed: Pinned bookmarks are displayed first in ATOM/RSS feeds
Fixes #1485
Diffstat (limited to 'application/bookmark/BookmarkFileService.php')
-rw-r--r--application/bookmark/BookmarkFileService.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/application/bookmark/BookmarkFileService.php b/application/bookmark/BookmarkFileService.php
index b3a90ed4..e3a61146 100644
--- a/application/bookmark/BookmarkFileService.php
+++ b/application/bookmark/BookmarkFileService.php
@@ -114,8 +114,13 @@ class BookmarkFileService implements BookmarkServiceInterface
114 /** 114 /**
115 * @inheritDoc 115 * @inheritDoc
116 */ 116 */
117 public function search($request = [], $visibility = null, $caseSensitive = false, $untaggedOnly = false) 117 public function search(
118 { 118 $request = [],
119 $visibility = null,
120 $caseSensitive = false,
121 $untaggedOnly = false,
122 bool $ignoreSticky = false
123 ) {
119 if ($visibility === null) { 124 if ($visibility === null) {
120 $visibility = $this->isLoggedIn ? BookmarkFilter::$ALL : BookmarkFilter::$PUBLIC; 125 $visibility = $this->isLoggedIn ? BookmarkFilter::$ALL : BookmarkFilter::$PUBLIC;
121 } 126 }
@@ -124,6 +129,10 @@ class BookmarkFileService implements BookmarkServiceInterface
124 $searchtags = isset($request['searchtags']) ? $request['searchtags'] : ''; 129 $searchtags = isset($request['searchtags']) ? $request['searchtags'] : '';
125 $searchterm = isset($request['searchterm']) ? $request['searchterm'] : ''; 130 $searchterm = isset($request['searchterm']) ? $request['searchterm'] : '';
126 131
132 if ($ignoreSticky) {
133 $this->bookmarks->reorder('DESC', true);
134 }
135
127 return $this->bookmarkFilter->filter( 136 return $this->bookmarkFilter->filter(
128 BookmarkFilter::$FILTER_TAG | BookmarkFilter::$FILTER_TEXT, 137 BookmarkFilter::$FILTER_TAG | BookmarkFilter::$FILTER_TEXT,
129 [$searchtags, $searchterm], 138 [$searchtags, $searchterm],