Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php |
— | — | @@ -460,7 +460,7 @@ |
461 | 461 | } |
462 | 462 | |
463 | 463 | if ( count( $values ) ) { |
464 | | - $query .= "SELECT cl_from, cl_to FROM $catlinks WHERE cl_from IN(" . implode( ",", $values ) . ")"; |
| 464 | + $query = "SELECT cl_from, cl_to FROM $catlinks WHERE cl_from IN(" . implode( ",", $values ) . ")"; |
465 | 465 | $res = $dbr->query( $query, __METHOD__ ); |
466 | 466 | |
467 | 467 | foreach ( $res as $x ) { |
— | — | @@ -670,14 +670,8 @@ |
671 | 671 | $name = $imageTitle->getDBkey(); |
672 | 672 | $count = $image->pageCount(); |
673 | 673 | |
674 | | - $from = $args['from']; |
675 | | - $to = $args['to']; |
676 | | - if( !$from ) { |
677 | | - $from = 1; |
678 | | - } |
679 | | - if( !$to ) { |
680 | | - $to = $count; |
681 | | - } |
| 674 | + $from = array_key_exists( 'from', $args ) ? $args['from'] : 1; |
| 675 | + $to = array_key_exists( 'to', $args ) ? $args['to'] : $count; |
682 | 676 | |
683 | 677 | if( !is_numeric( $from ) || !is_numeric( $to ) ) { |
684 | 678 | return '<strong class="error">' . wfMsgForContent( 'proofreadpage_number_expected' ) . '</strong>'; |
— | — | @@ -721,11 +715,12 @@ |
722 | 716 | function renderPages( $input, $args, $parser ) { |
723 | 717 | $page_namespace = $this->page_namespace; |
724 | 718 | $index_namespace = $this->index_namespace; |
725 | | - $index = $args['index']; |
726 | | - $from = $args['from']; |
727 | | - $to = $args['to']; |
728 | | - $header = $args['header']; |
729 | 719 | |
| 720 | + $index = array_key_exists( 'index', $args ) ? $args['index'] : null; |
| 721 | + $from = array_key_exists( 'from', $args ) ? $args['from'] : null; |
| 722 | + $to = array_key_exists( 'to', $args ) ? $args['to'] : null; |
| 723 | + $header = array_key_exists( 'header', $args ) ? $args['header'] : null; |
| 724 | + |
730 | 725 | // abort if the tag is on an index page |
731 | 726 | if ( preg_match( "/^$index_namespace:(.*?)(\/([0-9]*)|)$/", $parser->Title()->getPrefixedText() ) ) { |
732 | 727 | return ''; |
— | — | @@ -918,23 +913,23 @@ |
919 | 914 | if( isset( $args['next'] ) ) { |
920 | 915 | $next = $args['next']; |
921 | 916 | } |
922 | | - if( $current ) { |
| 917 | + if( isset( $current ) ) { |
923 | 918 | $h_out .= "|current=$current"; |
924 | 919 | } |
925 | | - if( $prev ) { |
| 920 | + if( isset( $prev ) ) { |
926 | 921 | $h_out .= "|prev=$prev"; |
927 | 922 | } |
928 | | - if( $next ) { |
| 923 | + if( isset( $next ) ) { |
929 | 924 | $h_out .= "|next=$next"; |
930 | 925 | } |
931 | | - if( $from_pagenum ) { |
| 926 | + if( isset( $from_pagenum ) ) { |
932 | 927 | $h_out .= "|from=$from_pagenum"; |
933 | 928 | } |
934 | | - if( $to_pagenum ) { |
| 929 | + if( isset( $to_pagenum ) ) { |
935 | 930 | $h_out .= "|to=$to_pagenum"; |
936 | 931 | } |
937 | 932 | foreach ( $attributes as $key => $val ) { |
938 | | - if( $args[$key] ) { |
| 933 | + if( array_key_exists( $key, $args ) ) { |
939 | 934 | $val = $args[$key]; |
940 | 935 | } |
941 | 936 | $h_out .= "|$key=$val"; |