mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[XenForo] fix: sort items by date in descending order (#2633)
This commit is contained in:
parent
bb81af086f
commit
a28481aaa8
1 changed files with 4 additions and 3 deletions
|
@ -149,10 +149,11 @@ class XenForoBridge extends BridgeAbstract {
|
|||
break;
|
||||
}
|
||||
|
||||
while(count($this->items) > $this->getInput('limit')) {
|
||||
array_shift($this->items);
|
||||
}
|
||||
usort($this->items, function($a, $b) {
|
||||
return $b['timestamp'] <=> $a['timestamp'];
|
||||
});
|
||||
|
||||
$this->items = array_slice($this->items, 0, $this->getInput('limit'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue