Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -91,8 +91,9 @@ |
92 | 92 | $pagenr = intval( array_pop( $parts ) ); |
93 | 93 | } |
94 | 94 | $count = $image->pageCount(); |
95 | | - if ( $pagenr < 1 || $pagenr > $count || $count <= 1 ) |
| 95 | + if ( $pagenr < 1 || $pagenr > $count || $count <= 1 ) { |
96 | 96 | return $err; |
| 97 | + } |
97 | 98 | $name = $image->getTitle()->getText(); |
98 | 99 | $index_name = "$index_namespace:$name"; |
99 | 100 | $prev_name = "$page_namespace:$name/" . ( $pagenr - 1 ); |
— | — | @@ -604,10 +605,12 @@ |
605 | 606 | if( !$from ) $from = 1; |
606 | 607 | if( !$to ) $to = $count; |
607 | 608 | |
608 | | - if( !is_numeric($from) || !is_numeric($to) ) |
| 609 | + if( !is_numeric( $from ) || !is_numeric( $to ) ) { |
609 | 610 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_number_expected' ) . '</strong>'; |
610 | | - if( ($from > $to) || ($from < 1) || ($to < 1 ) || ($to > $count) ) |
| 611 | + } |
| 612 | + if( ($from > $to) || ($from < 1) || ($to < 1 ) || ($to > $count) ) { |
611 | 613 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_invalid_interval' ) . '</strong>'; |
| 614 | + } |
612 | 615 | |
613 | 616 | for ( $i = $from - 1; $i < $to; $i++ ) { |
614 | 617 | if ( !isset( $query ) ) { |
— | — | @@ -685,10 +688,13 @@ |
686 | 689 | $from = $args['from']; |
687 | 690 | $to = $args['to']; |
688 | 691 | |
689 | | - if( ! $index ) return '<strong class="error">' . wfMsgForContent( 'proofreadpage_index_expected' ) . '</strong>'; |
| 692 | + if( ! $index ) { |
| 693 | + return '<strong class="error">' . wfMsgForContent( 'proofreadpage_index_expected' ) . '</strong>'; |
| 694 | + } |
690 | 695 | $index_title = Title::newFromText( "$index_namespace:$index" ); |
691 | | - if( ! $index_title || ! $index_title->exists() ) |
| 696 | + if( ! $index_title || ! $index_title->exists() ) { |
692 | 697 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_nosuch_index' ) . '</strong>'; |
| 698 | + } |
693 | 699 | |
694 | 700 | $out = '<span id="pr_index" class="hiddenStructure"><a href="'.$index_title->escapeFullUrl().'">'.$index_namespace.'</a> </span>'; |
695 | 701 | list( $links, $params, $attributes ) = pr_parse_index( $index_title ); |
— | — | @@ -707,14 +713,17 @@ |
708 | 714 | if( !$from ) $from = 1; |
709 | 715 | if( !$to ) $to = $count; |
710 | 716 | |
711 | | - if(!is_numeric($from) || !is_numeric($to)) |
| 717 | + if( !is_numeric( $from ) || !is_numeric( $to ) ) { |
712 | 718 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_number_expected' ) . '</strong>'; |
713 | | - if( ($from > $to) || ($from < 1) || ($to < 1 ) || ($to > $count) ) |
| 719 | + } |
| 720 | + if( ($from > $to) || ($from < 1) || ($to < 1 ) || ($to > $count) ) { |
714 | 721 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_invalid_interval' ) . '</strong>'; |
715 | | - if( $to - $from > 1000 ) |
| 722 | + } |
| 723 | + if( $to - $from > 1000 ) { |
716 | 724 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_interval_too_large' ) . '</strong>'; |
| 725 | + } |
717 | 726 | |
718 | | - for($i=$from; $i<=$to;$i++){ |
| 727 | + for( $i=$from; $i<=$to;$i++ ) { |
719 | 728 | $text = "$page_namespace:$index/" . $i; |
720 | 729 | list($pagenum, $links, $mode) = pr_pageNumber($i,$params); |
721 | 730 | $input = "{{:MediaWiki:Proofreadpage_pagenum_template|page=".$text."|num=$pagenum}}"; |