Index: trunk/extensions/LuceneSearch.php |
— | — | @@ -163,15 +163,17 @@ |
164 | 164 | $first = max($whichchunk - 11, 0); |
165 | 165 | $last = min($numchunks, $whichchunk + 11); |
166 | 166 | //$wgOut->addWikiText("whichchunk=$whichchunk numchunks=$numchunks first=$first last=$last num=".count($chunks)." limit=$limit offset=$offset results=".count($results)."\n\n"); |
167 | | - for($i = $first; $i < $last; $i++) { |
168 | | - if ($i === $whichchunk) |
169 | | - $prevnext .= "<strong>".($i+1)."</strong> "; |
170 | | - else |
171 | | - $prevnext .= "<a href=\"". |
172 | | - $this->makelink($q, $limit*$i, |
173 | | - $limit)."\">".($i+1)."</a> "; |
| 167 | + if ($last - $first > 1) { |
| 168 | + for($i = $first; $i < $last; $i++) { |
| 169 | + if ($i === $whichchunk) |
| 170 | + $prevnext .= "<strong>".($i+1)."</strong> "; |
| 171 | + else |
| 172 | + $prevnext .= "<a href=\"". |
| 173 | + $this->makelink($q, $limit*$i, |
| 174 | + $limit)."\">".($i+1)."</a> "; |
| 175 | + } |
174 | 176 | } |
175 | | - if ($whichchuck < $numchunks) |
| 177 | + if ($whichchuck < $last-1) |
176 | 178 | $prevnext .= "<a href=\"". |
177 | 179 | $this->makelink($q, $offset + $limit, $limit)."\">". |
178 | 180 | wfMsg("searchnext")."</a> "; |