aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkDB.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r--application/LinkDB.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php
index cdd68cfb..1f7c28cd 100644
--- a/application/LinkDB.php
+++ b/application/LinkDB.php
@@ -107,8 +107,7 @@ class LinkDB implements Iterator, Countable, ArrayAccess
107 $hidePublicLinks, 107 $hidePublicLinks,
108 $redirector = '', 108 $redirector = '',
109 $redirectorEncode = true 109 $redirectorEncode = true
110 ) 110 ) {
111 {
112 $this->datastore = $datastore; 111 $this->datastore = $datastore;
113 $this->loggedIn = $isLoggedIn; 112 $this->loggedIn = $isLoggedIn;
114 $this->hidePublicLinks = $hidePublicLinks; 113 $this->hidePublicLinks = $hidePublicLinks;
@@ -317,8 +316,7 @@ You use the community supported version of the original Shaarli project, by Seba
317 } else { 316 } else {
318 $link['real_url'] .= $link['url']; 317 $link['real_url'] .= $link['url'];
319 } 318 }
320 } 319 } else {
321 else {
322 $link['real_url'] = $link['url']; 320 $link['real_url'] = $link['url'];
323 } 321 }
324 322
@@ -403,7 +401,8 @@ You use the community supported version of the original Shaarli project, by Seba
403 * 401 *
404 * @return array list of shaare found. 402 * @return array list of shaare found.
405 */ 403 */
406 public function filterDay($request) { 404 public function filterDay($request)
405 {
407 $linkFilter = new LinkFilter($this->links); 406 $linkFilter = new LinkFilter($this->links);
408 return $linkFilter->filter(LinkFilter::$FILTER_DAY, $request); 407 return $linkFilter->filter(LinkFilter::$FILTER_DAY, $request);
409 } 408 }
@@ -492,8 +491,7 @@ You use the community supported version of the original Shaarli project, by Seba
492 $delete = empty($to); 491 $delete = empty($to);
493 // True for case-sensitive tag search. 492 // True for case-sensitive tag search.
494 $linksToAlter = $this->filterSearch(['searchtags' => $from], true); 493 $linksToAlter = $this->filterSearch(['searchtags' => $from], true);
495 foreach($linksToAlter as $key => &$value) 494 foreach ($linksToAlter as $key => &$value) {
496 {
497 $tags = preg_split('/\s+/', trim($value['tags'])); 495 $tags = preg_split('/\s+/', trim($value['tags']));
498 if (($pos = array_search($from, $tags)) !== false) { 496 if (($pos = array_search($from, $tags)) !== false) {
499 if ($delete) { 497 if ($delete) {
@@ -536,7 +534,7 @@ You use the community supported version of the original Shaarli project, by Seba
536 { 534 {
537 $order = $order === 'ASC' ? -1 : 1; 535 $order = $order === 'ASC' ? -1 : 1;
538 // Reorder array by dates. 536 // Reorder array by dates.
539 usort($this->links, function($a, $b) use ($order) { 537 usort($this->links, function ($a, $b) use ($order) {
540 if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) { 538 if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
541 return $a['sticky'] ? -1 : 1; 539 return $a['sticky'] ? -1 : 1;
542 } 540 }