We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a76722 commit 585b075Copy full SHA for 585b075
phpmyfaq/src/phpMyFAQ/Pagination.php
@@ -277,9 +277,16 @@ public function render(): string
277
* @param string $url url
278
* @param int $page page number
279
*/
280
- protected function renderUrl(string $url, int $page): string
+ protected function renderUrl(string $url = '', int $page = 1): string
281
{
282
- return sprintf($this->rewriteUrl, $page);
+ if ($url === '') {
283
+ $url = sprintf($this->rewriteUrl, $page);
284
+ } else {
285
+ $cleanedUrl = Strings::preg_replace(['$&(amp;|)' . $this->pageParamName . '=(\d+)$'], '', $url);
286
+ $url = sprintf('%s&%s=%d', $cleanedUrl, $this->pageParamName, $page);
287
+ }
288
+
289
+ return $url;
290
}
291
292
/**
0 commit comments