Files
FreshRSS/app/views/helpers/htmlPagination.phtml
Mehmet 27c2b18822 Shared queries: keep user search in HTML pagination (#9545)
Fix the paging bug noticed in #9544.

In the HTML view of a shared user query, the pagination links did not include the `search` parameter, so the user search was lost when going to the next page.

The pagination links now keep the user search (URL-encoded). The common part of the URLs is factored out, using `&` consistently.

Tested locally with a shared query of 60 entries and `search=x`: the second page now only shows matching entries.
2026-11-09 08:47:37 +01:00

25 lines
918 B
PHTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
/** @var FreshRSS_View $this */
$url = $this->userQuery->sharedUrlHtml() . '&amp;nb=' . FreshRSS_Context::$number;
$search = FreshRSS_Context::$search->toString();
if ($search !== '') {
$url .= '&amp;search=' . rawurlencode($search);
}
?>
<nav class="nav-pagination nav-list">
<ul class="pagination">
<?php if (FreshRSS_Context::$offset > 0): ?>
<li class="item pager-first">
<a href="<?= $url ?>">« <?= _t('conf.logs.pagination.first') ?></a>
</li>
<li class="item pager-previous">
<a href="<?= $url . '&amp;offset=' . max(0, FreshRSS_Context::$offset - FreshRSS_Context::$number) ?>">‹ <?= _t('conf.logs.pagination.previous') ?></a>
</li>
<?php endif; ?>
<li class="item pager-next">
<a href="<?= $url . '&amp;offset=' . (FreshRSS_Context::$offset + FreshRSS_Context::$number) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a>
</li>
</ul>
</nav>