aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/LinkDB.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-08-07 13:18:02 +0200
committerArthurHoaro <arthur@hoa.ro>2019-08-07 13:18:02 +0200
commit9f9627059a0b17de45a90e3c5fad9c1a49318151 (patch)
tree7d977b55db34ff63d3148d885805a1859f0dba09 /application/bookmark/LinkDB.php
parent1a6d61766a80369579041e5a80831f9f6754fe48 (diff)
downloadShaarli-9f9627059a0b17de45a90e3c5fad9c1a49318151.tar.gz
Shaarli-9f9627059a0b17de45a90e3c5fad9c1a49318151.tar.zst
Shaarli-9f9627059a0b17de45a90e3c5fad9c1a49318151.zip
Make sure that bookmark sort is consistent, even with equal timestamps
Fixes #1348
Diffstat (limited to 'application/bookmark/LinkDB.php')
-rw-r--r--application/bookmark/LinkDB.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/application/bookmark/LinkDB.php b/application/bookmark/LinkDB.php
index efde8468..f01c7ee6 100644
--- a/application/bookmark/LinkDB.php
+++ b/application/bookmark/LinkDB.php
@@ -102,7 +102,7 @@ class LinkDB implements Iterator, Countable, ArrayAccess
102 $isLoggedIn, 102 $isLoggedIn,
103 $hidePublicLinks 103 $hidePublicLinks
104 ) { 104 ) {
105 105
106 $this->datastore = $datastore; 106 $this->datastore = $datastore;
107 $this->loggedIn = $isLoggedIn; 107 $this->loggedIn = $isLoggedIn;
108 $this->hidePublicLinks = $hidePublicLinks; 108 $this->hidePublicLinks = $hidePublicLinks;
@@ -415,7 +415,7 @@ You use the community supported version of the original Shaarli project, by Seba
415 $visibility = 'all', 415 $visibility = 'all',
416 $untaggedonly = false 416 $untaggedonly = false
417 ) { 417 ) {
418 418
419 // Filter link database according to parameters. 419 // Filter link database according to parameters.
420 $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : ''; 420 $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : '';
421 $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : ''; 421 $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : '';
@@ -533,6 +533,9 @@ You use the community supported version of the original Shaarli project, by Seba
533 if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) { 533 if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
534 return $a['sticky'] ? -1 : 1; 534 return $a['sticky'] ? -1 : 1;
535 } 535 }
536 if ($a['created'] == $b['created']) {
537 return $a['id'] < $b['id'] ? 1 * $order : -1 * $order;
538 }
536 return $a['created'] < $b['created'] ? 1 * $order : -1 * $order; 539 return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
537 }); 540 });
538 541