Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -585,12 +585,21 @@ |
586 | 586 | $totalrescnt = count( $this->articles ) + count( $this->children ) + |
587 | 587 | ( $this->showGallery ? $this->gallery->count() : 0 ); |
588 | 588 | |
589 | | - if ( $dbcnt == $rescnt || ( ( $totalrescnt == $this->limit || $this->from |
590 | | - || $this->until ) && $dbcnt > $rescnt ) ) |
| 589 | + # Check if there's a "from" or "until" for anything |
| 590 | + $fromOrUntil = false; |
| 591 | + foreach ( array( 'page', 'subcat', 'file' ) as $type ) { |
| 592 | + if ( $this->from[$type] !== null || $this->until[$type] !== null ) { |
| 593 | + $fromOrUntil = true; |
| 594 | + break; |
| 595 | + } |
| 596 | + } |
| 597 | + |
| 598 | + if ( $dbcnt == $rescnt || ( ( $totalrescnt == $this->limit || $fromOrUntil ) |
| 599 | + && $dbcnt > $rescnt ) ) |
591 | 600 | { |
592 | 601 | # Case 1: seems sane. |
593 | 602 | $totalcnt = $dbcnt; |
594 | | - } elseif ( $totalrescnt < $this->limit && !$this->from && !$this->until ) { |
| 603 | + } elseif ( $totalrescnt < $this->limit && !$fromOrUntil ) { |
595 | 604 | # Case 2: not sane, but salvageable. Use the number of results. |
596 | 605 | # Since there are fewer than 200, we can also take this opportunity |
597 | 606 | # to refresh the incorrect category table entry -- which should be |