r95292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95291‎ | r95292 | r95293 >
Date:00:51, 23 August 2011
Author:johnduhart
Status:ok
Tags:
Comment:
Followup r94418, use isset() to check if a value is in the array
Modified paths:
  • /trunk/extensions/ProofreadPage/ApiQueryProofread.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ApiQueryProofread.php
@@ -71,10 +71,12 @@
7272
7373 $result = $this->getResult();
7474 foreach ( $data['query']['pages'] as $pageid => $data) {
75 - $pageQuality = $qualityLevels[ $data['categories'][0]['title'] ];
76 - if ( $pageQuality === null ) {
 75+ $title = $data['categories'][0]['title'];
 76+ if ( !isset( $qualityLevels[ $title ] ) ) {
7777 continue;
7878 }
 79+
 80+ $pageQuality = $qualityLevels[ $title ];
7981 $val = array( 'quality' => $pageQuality, 'quality_text' => $qualityText[ $pageQuality ] );
8082 $result->addValue( array( 'query', 'pages', $pageid ), 'proofread', $val );
8183 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94418* (bug 28893) Proofread Page extension needs an API module to retrieve page s...reedy15:44, 13 August 2011

Status & tagging log