X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialSearch.php;h=eeb8823ffb48dd6c561cd59706c7b8a73081d75c;hb=a840e8308989ce61886778c70f26d2e088abb363;hp=e5adeb53b4f4c83a1576d210f563db26297d857d;hpb=08a3993adcd046f47cc47d58c8e41959840ffb9a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index e5adeb53b4..eeb8823ffb 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -435,9 +435,17 @@ class SpecialSearch extends SpecialPage { // prev/next links if ( $totalRes > $this->limit || $this->offset ) { + // Allow matches to define the correct offset, as interleaved + // AB testing may require a different next page offset. + if ( $textMatches && $textMatches->getOffset() !== null ) { + $offset = $textMatches->getOffset(); + } else { + $offset = $this->offset; + } + $prevnext = $this->getLanguage()->viewPrevNext( $this->getPageTitle(), - $this->offset, + $offset, $this->limit, $this->powerSearchOptions() + [ 'search' => $term ], $this->limit + $this->offset >= $totalRes