From 30bc0bb884e633f35123c5f132c989b316568888 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 15 Jan 2024 13:43:54 +0100 Subject: [PATCH] ViewPhotoAlbum: don't include empty $by in page links --- controllers/ViewPhotoAlbum.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/ViewPhotoAlbum.php b/controllers/ViewPhotoAlbum.php index 59f7727..f6872df 100644 --- a/controllers/ViewPhotoAlbum.php +++ b/controllers/ViewPhotoAlbum.php @@ -60,7 +60,7 @@ class ViewPhotoAlbum extends HTMLController 'label' => $contributor['first_name'], 'caption' => sprintf('By %s (%s photos)', $contributor['first_name'], $contributor['num_assets']), - 'link' => $tag->getUrl() . '/?by=' . $contributor['slug'], + 'link' => $tag->getUrl() . '?by=' . $contributor['slug'], ]; } } @@ -119,7 +119,7 @@ class ViewPhotoAlbum extends HTMLController 'items_per_page' => self::PER_PAGE, 'start' => ($current_page - 1) * self::PER_PAGE, 'base_url' => $tag->getUrl(), - 'page_slug' => 'page/%PAGE%/' . (isset($active_filter) ? '?by=' . $active_filter : ''), + 'page_slug' => 'page/%PAGE%/' . (!empty($active_filter) ? '?by=' . $active_filter : ''), 'index_class' => 'pagination-lg justify-content-around justify-content-lg-center', ]); $this->page->adopt(new PageIndexWidget($index));