r51791 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51790‎ | r51791 | r51792 >
Date:13:23, 12 June 2009
Author:thomasv
Status:ok
Tags:
Comment:
style changes only; no functional change
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -91,8 +91,9 @@
9292 $pagenr = intval( array_pop( $parts ) );
9393 }
9494 $count = $image->pageCount();
95 - if ( $pagenr < 1 || $pagenr > $count || $count <= 1 )
 95+ if ( $pagenr < 1 || $pagenr > $count || $count <= 1 ) {
9696 return $err;
 97+ }
9798 $name = $image->getTitle()->getText();
9899 $index_name = "$index_namespace:$name";
99100 $prev_name = "$page_namespace:$name/" . ( $pagenr - 1 );
@@ -604,10 +605,12 @@
605606 if( !$from ) $from = 1;
606607 if( !$to ) $to = $count;
607608
608 - if( !is_numeric($from) || !is_numeric($to) )
 609+ if( !is_numeric( $from ) || !is_numeric( $to ) ) {
609610 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) ) {
611613 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_invalid_interval' ) . '</strong>';
 614+ }
612615
613616 for ( $i = $from - 1; $i < $to; $i++ ) {
614617 if ( !isset( $query ) ) {
@@ -685,10 +688,13 @@
686689 $from = $args['from'];
687690 $to = $args['to'];
688691
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+ }
690695 $index_title = Title::newFromText( "$index_namespace:$index" );
691 - if( ! $index_title || ! $index_title->exists() )
 696+ if( ! $index_title || ! $index_title->exists() ) {
692697 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_nosuch_index' ) . '</strong>';
 698+ }
693699
694700 $out = '<span id="pr_index" class="hiddenStructure"><a href="'.$index_title->escapeFullUrl().'">'.$index_namespace.'</a> </span>';
695701 list( $links, $params, $attributes ) = pr_parse_index( $index_title );
@@ -707,14 +713,17 @@
708714 if( !$from ) $from = 1;
709715 if( !$to ) $to = $count;
710716
711 - if(!is_numeric($from) || !is_numeric($to))
 717+ if( !is_numeric( $from ) || !is_numeric( $to ) ) {
712718 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) ) {
714721 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_invalid_interval' ) . '</strong>';
715 - if( $to - $from > 1000 )
 722+ }
 723+ if( $to - $from > 1000 ) {
716724 return '<strong class="error">' . wfMsgForContent( 'proofreadpage_interval_too_large' ) . '</strong>';
 725+ }
717726
718 - for($i=$from; $i<=$to;$i++){
 727+ for( $i=$from; $i<=$to;$i++ ) {
719728 $text = "$page_namespace:$index/" . $i;
720729 list($pagenum, $links, $mode) = pr_pageNumber($i,$params);
721730 $input = "{{:MediaWiki:Proofreadpage_pagenum_template|page=".$text."|num=$pagenum}}";

Status & tagging log