Index: trunk/extensions/ProofreadPage/ProofreadPage.i18n.php |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | 'proofreadpage_nosuch_index' => 'Error: no such index', |
19 | 19 | 'proofreadpage_number_expected' => 'Error: numeric value expected', |
20 | 20 | 'proofreadpage_interval_too_large'=> 'Error: interval too large', |
| 21 | + 'proofreadpage_invalid_interval' => 'Error: invalid interval', |
21 | 22 | 'proofreadpage_nextpage' => 'Next page', |
22 | 23 | 'proofreadpage_prevpage' => 'Previous page', |
23 | 24 | 'proofreadpage_header' => 'Header (noinclude):', |
Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -591,7 +591,17 @@ |
592 | 592 | $page_ns_index = NS_MAIN; |
593 | 593 | } |
594 | 594 | |
595 | | - for ( $i = 0; $i < $count ; $i++ ) { |
| 595 | + $from = $args['from']; |
| 596 | + $to = $args['to']; |
| 597 | + if( !$from ) $from = 1; |
| 598 | + if( !$to ) $to = $count; |
| 599 | + |
| 600 | + if( !is_numeric($from) || !is_numeric($to) ) |
| 601 | + return '<strong class="error">' . wfMsgForContent( 'proofreadpage_number_expected' ) . '</strong>'; |
| 602 | + if( ($from > $to) || ($from < 1) || ($to < 1 ) || ($to > $count) ) |
| 603 | + return '<strong class="error">' . wfMsgForContent( 'proofreadpage_invalid_interval' ) . '</strong>'; |
| 604 | + |
| 605 | + for ( $i = $from - 1; $i < $to; $i++ ) { |
596 | 606 | if ( !isset( $query ) ) { |
597 | 607 | $query = "SELECT page_id, page_title, page_namespace"; |
598 | 608 | $query .= " FROM $pagetable WHERE (page_namespace=" . intval( $page_ns_index ) . " AND page_title IN("; |
— | — | @@ -616,7 +626,7 @@ |
617 | 627 | |
618 | 628 | $sk = $wgUser->getSkin(); |
619 | 629 | |
620 | | - for ( $i = 1; $i < $count + 1 ; $i++ ) { |
| 630 | + for ( $i = $from; $i < $to + 1; $i++ ) { |
621 | 631 | $pdbk = "$page_namespace:$name" . '/' . $i ; |
622 | 632 | list( $view, $links, $mode ) = pr_pageNumber( $i, $args ); |
623 | 633 | |