From 0e1b84263e87f4304cc9216340e67e596dbfbe16 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 19 Jan 2016 21:41:14 +0100 Subject: [PATCH] Return items starting at the end, not the beginning when working with limits --- bridges/MangareaderBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/MangareaderBridge.php b/bridges/MangareaderBridge.php index 17523d8..60fa885 100644 --- a/bridges/MangareaderBridge.php +++ b/bridges/MangareaderBridge.php @@ -96,7 +96,7 @@ class MangareaderBridge extends BridgeAbstract{ $query = "(.//*[@id='listing']//tr)[position() > 1]"; if($limit !== -1){ - $query = "(.//*[@id='listing']//tr)[position() > 1][position() <= " . $limit . "]"; + $query = "(.//*[@id='listing']//tr)[position() > 1][position() > last() - " . $limit . "]"; } $chapters = $xpath->query($query);