Always sort shares in a reliable way
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
f40f7abbaf
commit
c63039bb83
|
@ -156,10 +156,12 @@ class MountProvider implements IMountProvider {
|
||||||
// sort by stime, the super share will be based on the least recent share
|
// sort by stime, the super share will be based on the least recent share
|
||||||
foreach ($tmp as &$tmp2) {
|
foreach ($tmp as &$tmp2) {
|
||||||
@usort($tmp2, function ($a, $b) {
|
@usort($tmp2, function ($a, $b) {
|
||||||
if ($a->getShareTime() <= $b->getShareTime()) {
|
$aTime = $a->getShareTime()->getTimestamp();
|
||||||
return -1;
|
$bTime = $b->getShareTime()->getTimestamp();
|
||||||
|
if ($aTime === $bTime) {
|
||||||
|
return $a->getId() < $b->getId() ? -1 : 1;
|
||||||
}
|
}
|
||||||
return 1;
|
return $aTime < $bTime ? -1 : 1;
|
||||||
});
|
});
|
||||||
$result[] = $tmp2;
|
$result[] = $tmp2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -550,7 +550,7 @@ interface IShare {
|
||||||
* This is mainly for public shares. It will signal that the share page should
|
* This is mainly for public shares. It will signal that the share page should
|
||||||
* hide download buttons etc.
|
* hide download buttons etc.
|
||||||
*
|
*
|
||||||
* @param bool $ro
|
* @param bool $hide
|
||||||
* @return IShare
|
* @return IShare
|
||||||
* @since 15.0.0
|
* @since 15.0.0
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue