From ed0eb1401c5c38eb8f14d4c4d2dc35bff3f2191a Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 8 Apr 2024 21:31:23 +0100 Subject: [PATCH] [rss_images] fix page matching... for real? --- ext/rss_images/main.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/ext/rss_images/main.php b/ext/rss_images/main.php index 18434c88..85d8ce8d 100644 --- a/ext/rss_images/main.php +++ b/ext/rss_images/main.php @@ -24,17 +24,12 @@ class RSSImages extends Extension public function onPageRequest(PageRequestEvent $event): void { global $config; - if ($event->page_starts_with("rss/images")) { - if ($event->page_matches("rss/images/{search}/{page}")) { - $search_terms = Tag::explode($event->get_arg('search')); - $page_number = int_escape($event->get_arg('page')); - } elseif ($event->page_matches("rss/images/{page}")) { - $search_terms = []; - $page_number = int_escape($event->get_arg('page')); - } else { - $search_terms = []; - $page_number = 1; - } + if ( + $event->page_matches("rss/images", paged: true) + || $event->page_matches("rss/images/{search}", paged: true) + ) { + $search_terms = Tag::explode($event->get_arg('search', "")); + $page_number = $event->get_iarg('page_num', 1); $page_size = $config->get_int(IndexConfig::IMAGES); if (SPEED_HAX && $page_number > 9) { return;