1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-07 18:23:06 +02:00

[XenForo] fix: sort items by date in descending order (#2633)

This commit is contained in:
Dag
2022-04-11 00:42:53 +02:00
committed by GitHub
parent bb81af086f
commit a28481aaa8

View File

@ -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'));
}
/**