Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -447,16 +447,16 @@ |
448 | 448 | ######### |
449 | 449 | |
450 | 450 | function efLoadFlaggedRevs() { |
451 | | - global $wgUseRCPatrol, $wgUseNPPatrol, $wgFlaggedRevsNamespaces; |
| 451 | + global $wgUseRCPatrol, $wgFlaggedRevsNamespaces; |
| 452 | + # If patrolling is already on, then we know that it |
| 453 | + # was intended to have all namespaces patrollable. |
| 454 | + if( $wgUseRCPatrol ) { |
| 455 | + global $wgFlaggedRevsPatrolNamespaces, $wgCanonicalNamespaceNames; |
| 456 | + $wgFlaggedRevsPatrolNamespaces = array_keys( $wgCanonicalNamespaceNames ); |
| 457 | + } |
452 | 458 | # Use RC Patrolling to check for vandalism |
453 | 459 | # When revisions are flagged, they count as patrolled |
454 | 460 | if( !empty($wgFlaggedRevsNamespaces) ) { |
455 | | - # If patrolling is already on, then we know that it |
456 | | - # was intended to have all namespaces patrollable. |
457 | | - if( $wgUseRCPatrol || $wgUseNPPatrol ) { |
458 | | - global $wgFlaggedRevsPatrolNamespaces, $wgCanonicalNamespaceNames; |
459 | | - $wgFlaggedRevsPatrolNamespaces = array_keys( $wgCanonicalNamespaceNames ); |
460 | | - } |
461 | 461 | $wgUseRCPatrol = true; |
462 | 462 | } |
463 | 463 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -609,9 +609,19 @@ |
610 | 610 | return false; |
611 | 611 | } |
612 | 612 | $flaggedArticle = FlaggedArticle::getTitleInstance( $title ); |
| 613 | + # The page must be in a patrollable namespace... |
613 | 614 | if( !$flaggedArticle->isPatrollable() ) { |
614 | | - $result = false; |
615 | | - return false; |
| 615 | + global $wgUseNPPatrol; |
| 616 | + # ...unless the page is not in a reviewable namespace and |
| 617 | + # new page patrol is enabled. In this scenario, any edits |
| 618 | + # to pages outside of patrollable namespaces would already |
| 619 | + # be auto-patrolled, except for the new page edits. |
| 620 | + if( $wgUseNPPatrol && !$flaggedArticle->isReviewable() ) { |
| 621 | + return true; |
| 622 | + } else { |
| 623 | + $result = false; |
| 624 | + return false; |
| 625 | + } |
616 | 626 | } |
617 | 627 | return true; |
618 | 628 | } |
— | — | @@ -744,7 +754,10 @@ |
745 | 755 | $patrol = $wgUser->isAllowed('autopatrolother'); |
746 | 756 | $record = true; |
747 | 757 | } else { |
748 | | - $patrol = true; // mark by default |
| 758 | + global $wgUseNPPatrol; |
| 759 | + # Mark patrolled by default unless this is a new page |
| 760 | + # and new page patrol is enabled. |
| 761 | + $patrol = !( $wgUseNPPatrol && !empty($rc->mAttribs['rc_new']) ); |
749 | 762 | } |
750 | 763 | if( $patrol ) { |
751 | 764 | RevisionReview::updateRecentChanges( $rc->getTitle(), $rc->mAttribs['rc_this_oldid'] ); |