r76230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76229‎ | r76230 | r76231 >
Date:03:30, 7 November 2010
Author:aaron
Status:deferred
Tags:
Comment:
* "sighted" -> "checked" (in comments and qqq)
* FR_SIGHTED -> FR_CHECKED
* fixed undefined var in expandRevisionTags(), validate params a bit more
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -37,8 +37,8 @@
3838 define( 'FR_TEXT', 3 );
3939
4040 # Level constants...
41 -if ( !defined( 'FR_SIGHTED' ) )
42 - define( 'FR_SIGHTED', 0 ); // "basic"/"checked"
 41+if ( !defined( 'FR_CHECKED' ) )
 42+ define( 'FR_CHECKED', 0 ); // "basic"/"checked"
4343 if ( !defined( 'FR_QUALITY' ) )
4444 define( 'FR_QUALITY', 1 );
4545 if ( !defined( 'FR_PRISTINE' ) )
@@ -64,7 +64,7 @@
6565 # IMPORTANT: DO NOT EDIT THIS FILE
6666 # When configuring globals, set them at LocalSettings.php instead
6767
68 -# This will only distinguish "sighted", "quality", and unreviewed
 68+# This will only distinguish "checked", "quality", and unreviewed
6969 # A small icon will show in the upper right hand corner
7070 $wgSimpleFlaggedRevsUI = true; // @TODO: remove when ready
7171 # For visitors, only show tags/icons for unreviewed/outdated pages
@@ -91,7 +91,7 @@
9292 # (a) directly to the stable version by users with 'autoreview'/'bot'
9393 # (b) self-reversions back to the stable version by any user
9494 $wgFlaggedRevsAutoReview = true;
95 -# If $wgFlaggedRevsAutoReview, auto-review new pages as minimally "sighted"?
 95+# If $wgFlaggedRevsAutoReview, auto-review new pages as minimally "checked"?
9696 $wgFlaggedRevsAutoReviewNew = true;
9797
9898 # Define the tags we can use to rate an article, number of levels,
@@ -589,15 +589,15 @@
590590 $wgLogNames['review'] = 'review-logpage';
591591 $wgLogHeaders['review'] = 'review-logpagetext';
592592 # Various actions are used for log filtering ...
593 -$wgLogActions['review/approve'] = 'review-logentry-app'; // sighted (again)
 593+$wgLogActions['review/approve'] = 'review-logentry-app'; // checked (again)
594594 $wgLogActions['review/approve2'] = 'review-logentry-app'; // quality (again)
595 -$wgLogActions['review/approve-i'] = 'review-logentry-app'; // sighted (first time)
 595+$wgLogActions['review/approve-i'] = 'review-logentry-app'; // checked (first time)
596596 $wgLogActions['review/approve2-i'] = 'review-logentry-app'; // quality (first time)
597 -$wgLogActions['review/approve-a'] = 'review-logentry-app'; // sighted (auto)
 597+$wgLogActions['review/approve-a'] = 'review-logentry-app'; // checked (auto)
598598 $wgLogActions['review/approve2-a'] = 'review-logentry-app'; // quality (auto)
599 -$wgLogActions['review/approve-ia'] = 'review-logentry-app'; // sighted (initial & auto)
 599+$wgLogActions['review/approve-ia'] = 'review-logentry-app'; // checked (initial & auto)
600600 $wgLogActions['review/approve2-ia'] = 'review-logentry-app'; // quality (initial & auto)
601 -$wgLogActions['review/unapprove'] = 'review-logentry-dis'; // was sighted
 601+$wgLogActions['review/unapprove'] = 'review-logentry-dis'; // was checked
602602 $wgLogActions['review/unapprove2'] = 'review-logentry-dis'; // was quality
603603
604604 # Add stable version log
Index: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc
@@ -21,7 +21,7 @@
2222 $blockEnd = $start + $BATCH_SIZE - 1;
2323 $count = 0;
2424 $changed = 0;
25 - $flags = FlaggedRevs::quickTags( FR_SIGHTED ); // Assume basic level
 25+ $flags = FlaggedRevs::quickTags( FR_CHECKED ); // Assume basic level
2626 while( $blockEnd <= $end ) {
2727 echo "...doing page_id from $blockStart to $blockEnd\n";
2828 $cond = "page_id BETWEEN $blockStart AND $blockEnd";
Index: trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php
@@ -60,7 +60,7 @@
6161 $messages['qqq'] = array(
6262 'stabilization-tab' => '{{Flagged Revs-small}}
6363
64 -Some skins (e.g. standard/classic) display an additional tab to control visibility of the page revisions, e.g. whether last revision should be included or perhaps the last sighted or published version.',
 64+Some skins (e.g. standard/classic) display an additional tab to control visibility of the page revisions, e.g. whether last revision should be included or perhaps the last checked or published version.',
6565 'stabilization' => '{{Flagged Revs-small}}
6666 Page title of Special:Stabilization.',
6767 'stabilization-text' => '{{Flagged Revs-small}}
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -358,7 +358,7 @@
359359 'revreview-hist-quality' => '{{Flagged Revs-small}}
360360 The accuracy "quality", as displayed on the page history after a revision with this setting.',
361361 'revreview-hist-basic' => '{{Flagged Revs-small}}
362 -The accuracy "sighted", as displayed on the page history after a revision with this setting.',
 362+The accuracy "checked", as displayed on the page history after a revision with this setting.',
363363 'revreview-hist-quality-user' => '{{Flagged Revs}}',
364364 'revreview-hist-basic-user' => '{{Flagged Revs}}',
365365 'revreview-hist-basic-auto' => '{{Flagged Revs}}',
@@ -391,7 +391,7 @@
392392 'revreview-accuracy-0' => '{{Flagged Revs-small}}
393393 This is the default configuration, i.e. the revision has not (yet) been reviewed.',
394394 'revreview-accuracy-1' => '{{Flagged Revs-small}}
395 -A basic check on vandalism ("sighted" as "has been seen/checked"). This configuration is considered as "flagged".',
 395+A basic check on vandalism ("checked" as "has been seen/checked"). This configuration is considered as "flagged".',
396396 'revreview-accuracy-2' => '{{Flagged Revs}}',
397397 'revreview-accuracy-3' => '{{Flagged Revs}}',
398398 'revreview-accuracy-4' => '{{Flagged Revs}}
@@ -407,7 +407,7 @@
408408 'revreview-basic-same' => '{{Flagged Revs}}
409409 * Parameter $2 is the date of the approval',
410410 'revreview-basic-source' => '{{Flagged Revs-small}}
411 -Displayed on the top of a page when you are viewing an old sighted version.
 411+Displayed on the top of a page when you are viewing an old checked version.
412412 * Example: [http://de.wikipedia.org/w/index.php?title=Deutsche_Sprache&oldid=46894374 de.wikipedia].
413413 * Parameter $2 is the date of the approval',
414414 'revreview-failed' => '{{Flagged Revs}}',
@@ -443,7 +443,7 @@
444444 {{Identical|Content page}}',
445445 'revreview-newest-basic' => '{{Flagged Revs}}',
446446 'revreview-newest-basic-i' => '{{Flagged Revs-small}}
447 -Used in the "flagged revs box" when you are viewing the latest draft version, but when there is a sighted revision, the stable version.
 447+Used in the "flagged revs box" when you are viewing the latest draft version, but when there is a checked revision, the stable version.
448448
449449 Example: [http://de.wikipedia.org/w/index.php?title=Deutsche_Sprache&stable=0 de.wikipedia].
450450 * Note, the example seems not to work, currently.',
@@ -466,7 +466,7 @@
467467 'revreview-quality-same' => '{{Flagged Revs}}',
468468 'revreview-quality-source' => "{{Flagged Revs-small}}
469469 Displayed on the top of a page when you are viewing an old quality version.
470 -* Example: [http://de.wikipedia.org/w/index.php?title=Deutsche_Sprache&oldid=46894374 de.wikipedia] (this is a sighted version, but it's the same for a quality version).
 470+* Example: [http://de.wikipedia.org/w/index.php?title=Deutsche_Sprache&oldid=46894374 de.wikipedia] (this is a checked version, but it's the same for a quality version).
471471 * Parameter $2 is the date of the approval",
472472 'revreview-quality-title' => '{{Flagged Revs}}',
473473 'revreview-quick-basic' => '{{Flagged Revs}}',
@@ -474,7 +474,7 @@
475475 'revreview-quick-basic-same' => '{{Flagged Revs}}',
476476 'revreview-quick-invalid' => '{{Flagged Revs}}',
477477 'revreview-quick-none' => '{{Flagged Revs-small}}
478 -Shown in the "flagged revs box" on the content page when there isn\'t any sighted or quality revision yet.',
 478+Shown in the "flagged revs box" on the content page when there isn\'t any checked or quality revision yet.',
479479 'revreview-quick-quality' => '{{Flagged Revs-small}}
480480 Used in the "flagged revs box" when viewing a quality version, while there are new changes (in a draft version) to be reviewed.',
481481 'revreview-quick-quality-old' => '{{Flagged Revs}}',
@@ -507,9 +507,9 @@
508508 'revreview-submit-reviewed' => '{{Flagged Revs}}',
509509 'revreview-submit-unreviewed' => '{{Flagged Revs}}',
510510 'revreview-successful' => '{{Flagged Revs-small}}
511 -Shown when a reviewer/editor has marked a revision as stable/sighted/... See also {{msg|revreview-successful2|pl=yes}}.',
 511+Shown when a reviewer/editor has marked a revision as stable/checked/... See also {{msg|revreview-successful2|pl=yes}}.',
512512 'revreview-successful2' => '{{Flagged Revs-small}}
513 -Shown when a reviewer/editor has marked a stable/sighted/... revision as unstable/unsighted/... After that, it can normally be reviewed again. See also {{msg|revreview-successful|pl=yes}}.',
 513+Shown when a reviewer/editor has marked a stable/checked/... revision as unstable/unchecked/... After that, it can normally be reviewed again. See also {{msg|revreview-successful|pl=yes}}.',
514514 'revreview-text' => "{{Flagged Revs-small}}
515515 Displayed in the review box for the reviewers' information.",
516516 'revreview-toggle-show' => '{{Optional}}
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -771,7 +771,7 @@
772772 $data = array();
773773 $level = self::pristineVersions() ? FR_PRISTINE : FR_QUALITY;
774774 if ( !self::qualityVersions() ) {
775 - $level = FR_SIGHTED;
 775+ $level = FR_CHECKED;
776776 }
777777 # Get the latest revision ID if not set
778778 if ( !$latest ) {
@@ -798,13 +798,13 @@
799799 );
800800 # If there is a revision of this level, track it...
801801 # Revisions reviewed to one level count as reviewed
802 - # at the lower levels (i.e. quality -> sighted).
 802+ # at the lower levels (i.e. quality -> checked).
803803 if ( $row ) {
804804 $id = $row->fr_rev_id;
805805 $ts = $row->rev_timestamp;
806806 } else {
807 - $id = $higherLevelId; // use previous (quality -> sighted)
808 - $ts = $higherLevelTS; // use previous (quality -> sighted)
 807+ $id = $higherLevelId; // use previous (quality -> checked)
 808+ $ts = $higherLevelTS; // use previous (quality -> checked)
809809 }
810810 # Get edits that actually are pending...
811811 if ( $id && $latest > $id ) {
@@ -1156,7 +1156,7 @@
11571157 /**
11581158 * Get the quality tier of review flags
11591159 * @param array $flags
1160 - * @return int, flagging tier (-1 for non-sighted)
 1160+ * @return int, flagging tier (-1 for non-checked)
11611161 */
11621162 public static function getLevelTier( array $flags ) {
11631163 if ( self::isPristine( $flags ) ) {
@@ -1164,7 +1164,7 @@
11651165 } elseif ( self::isQuality( $flags ) ) {
11661166 return FR_QUALITY; // 1
11671167 } elseif ( self::isSighted( $flags ) ) {
1168 - return FR_SIGHTED; // 0
 1168+ return FR_CHECKED; // 0
11691169 }
11701170 return -1;
11711171 }
@@ -1326,7 +1326,7 @@
13271327 $flags = self::getAutoReviewTags( $user, $oldSv->getTags() );
13281328 }
13291329 } else { // new page?
1330 - $flags = self::quickTags( FR_SIGHTED ); // use minimal level
 1330+ $flags = self::quickTags( FR_CHECKED ); // use minimal level
13311331 }
13321332 if ( !is_array( $flags ) ) {
13331333 wfProfileOut( __METHOD__ );
Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php
@@ -644,7 +644,7 @@
645645 }
646646 $oldFlags = $frev
647647 ? $frev->getTags() // existing tags
648 - : FlaggedRevs::quickTags( FR_SIGHTED ); // basic tags
 648+ : FlaggedRevs::quickTags( FR_CHECKED ); // basic tags
649649
650650 # If we are reviewing updates to a page, start off with the stable revision's
651651 # flags. Otherwise, we just fill them in with the selected revision's flags.
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -739,23 +739,23 @@
740740 * @return Array
741741 */
742742 public static function expandRevisionTags( $tags ) {
743 - # Set all flags to zero
744743 $flags = array();
745744 foreach ( FlaggedRevs::getTags() as $tag ) {
746 - $flags[$tag] = 0;
 745+ $flags[$tag] = 0; // init all flags values to zero
747746 }
748747 $tags = str_replace( '\n', "\n", $tags ); // B/C, old broken rows
 748+ // Tag string format is <tag:val\ntag:val\n...>
749749 $tags = explode( "\n", $tags );
750750 foreach ( $tags as $tuple ) {
751751 $set = explode( ':', $tuple, 2 );
752752 if ( count( $set ) == 2 ) {
753753 list( $tag, $value ) = $set;
754 - $value = intval( $value );
755 - # Add only currently recognized ones
 754+ $value = max( 0, (int)$value ); // validate
 755+ # Add only currently recognized tags
756756 if ( isset( $flags[$tag] ) ) {
757 - # If a level was removed, default to the highest
758 - $flags[$tag] = $value < count( $levels ) ?
759 - $value : count( $levels ) - 1;
 757+ $levels = FlaggedRevs::getTagLevels( $tag );
 758+ # If a level was removed, default to the highest...
 759+ $flags[$tag] = min( $value, count( $levels ) - 1 );
760760 }
761761 }
762762 }
Index: trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php
@@ -302,7 +302,7 @@
303303 $namespace = $vnamespaces;
304304 }
305305 $this->namespace = $namespace;
306 - # Sanity check level: 0 = sighted; 1 = quality; 2 = pristine
 306+ # Sanity check level: 0 = checked; 1 = quality; 2 = pristine
307307 $this->level = ( $level >= 0 && $level <= 2 ) ? $level : - 1;
308308 $this->category = $category ? str_replace( ' ', '_', $category ) : null;
309309 $this->size = ( $size !== null ) ? intval( $size ) : null;
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -90,7 +90,7 @@
9191 private function getActions() {
9292 $actions = array( 'approve' => 1, 'approve2' => 1, 'approve-a' => 1, 'approve-i' => 1,
9393 'approve-ia' => 1, 'approve2-i' => 1, 'unapprove' => 1, 'unapprove2' => 1 );
94 - if ( $this->level === 0 ) { // sighted revisions
 94+ if ( $this->level === 0 ) { // checked revisions
9595 $actions['approve2'] = 0;
9696 $actions['approve2-i'] = 0;
9797 $actions['unapprove2'] = 0;
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -278,7 +278,7 @@
279279 $this->mForm = $form;
280280 # Must be a content page...
281281 $this->namespace = FlaggedRevs::getReviewNamespaces();
282 - # Sanity check level: 0 = sighted; 1 = quality; 2 = pristine
 282+ # Sanity check level: 0 = checked; 1 = quality; 2 = pristine
283283 $this->level = ( $level >= 0 && $level <= 2 ) ? $level : - 1;
284284 $this->tag = $tag;
285285 $this->category = $category ? str_replace( ' ', '_', $category ) : null;
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -876,7 +876,7 @@
877877 $quality = FlaggedRevs::getRevQuality(
878878 $rc->mAttribs['rc_cur_id'], $revId, FR_MASTER );
879879 // Reviewed => patrolled
880 - if ( $quality !== false && $quality >= FR_SIGHTED ) {
 880+ if ( $quality !== false && $quality >= FR_CHECKED ) {
881881 RevisionReviewForm::updateRecentChanges( $rc->getTitle(), $revId );
882882 $rc->mAttribs['rc_patrolled'] = 1; // make sure irc/email notifs know status
883883 }
@@ -1122,7 +1122,7 @@
11231123 }
11241124 }
11251125 }
1126 - # Check implicitly sighted edits
 1126+ # Check implicitly checked edits
11271127 if ( $totalCheckedEditsNeeded && $wgFlaggedRevsAutoconfirm['totalCheckedEdits'] ) {
11281128 $dbr = wfGetDB( DB_SLAVE );
11291129 $res = $dbr->select( array( 'revision', 'flaggedpages' ), '1',
@@ -1316,7 +1316,7 @@
13171317 return true;
13181318 }
13191319 }
1320 - # Check implicitly sighted edits
 1320+ # Check implicitly checked edits
13211321 if ( $totalCheckedEditsNeeded && $wgFlaggedRevsAutopromote['totalCheckedEdits'] ) {
13221322 $dbr = isset( $dbr ) ? $dbr : wfGetDB( DB_SLAVE );
13231323 $res = $dbr->select( array( 'revision', 'flaggedpages' ), '1',
Index: trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php
@@ -173,7 +173,7 @@
174174 'end' => 'Stop listing at this page id.',
175175 'namespace' => 'The namespaces to enumerate.',
176176 'filterredir' => 'How to filter for redirects',
177 - 'filterlevel' => 'How to filter by quality (0=sighted,1=quality)',
 177+ 'filterlevel' => 'How to filter by quality (0=checked,1=quality)',
178178 'limit' => 'How many total pages to return.',
179179 'dir' => array(
180180 'In which direction to list.',
Index: trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php
@@ -164,7 +164,7 @@
165165 'end' => 'Stop listing at this page title.',
166166 'namespace' => 'The namespaces to enumerate.',
167167 'filterredir' => 'How to filter for redirects',
168 - 'filterlevel' => 'How to filter by quality (0=sighted,1=quality)',
 168+ 'filterlevel' => 'How to filter by quality (0=checked,1=quality)',
169169 'limit' => 'How many total pages to return.',
170170 );
171171 }

Status & tagging log