Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / includes / specialpage / ChangesListSpecialPage.php
index 5add448..f62b302 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  * @ingroup SpecialPage
  */
+use MediaWiki\Logger\LoggerFactory;
+use Wikimedia\Rdbms\ResultWrapper;
 
 /**
  * Special page which uses a ChangesList to show query results.
@@ -77,6 +79,14 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                $this->webOutput( $rows, $opts );
 
                $rows->free();
+
+               if ( $this->getConfig()->get( 'EnableWANCacheReaper' ) ) {
+                       // Clean up any bad page entries for titles showing up in RC
+                       DeferredUpdates::addUpdate( new WANCacheReapUpdate(
+                               $this->getDB(),
+                               LoggerFactory::getInstance( 'objectcache' )
+                       ) );
+               }
        }
 
        /**
@@ -140,11 +150,13 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                $opts = new FormOptions();
 
                $opts->add( 'hideminor', false );
+               $opts->add( 'hidemajor', false );
                $opts->add( 'hidebots', false );
                $opts->add( 'hidehumans', false );
                $opts->add( 'hideanons', false );
                $opts->add( 'hideliu', false );
                $opts->add( 'hidepatrolled', false );
+               $opts->add( 'hideunpatrolled', false );
                $opts->add( 'hidemyself', false );
                $opts->add( 'hidebyothers', false );
 
@@ -234,7 +246,10 @@ abstract class ChangesListSpecialPage extends SpecialPage {
 
                // Toggles
                if ( $opts['hideminor'] ) {
-                       $conds['rc_minor'] = 0;
+                       $conds[] = 'rc_minor = 0';
+               }
+               if ( $opts['hidemajor'] ) {
+                       $conds[] = 'rc_minor = 1';
                }
                if ( $opts['hidebots'] ) {
                        $conds['rc_bot'] = 0;
@@ -242,8 +257,13 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                if ( $opts['hidehumans'] ) {
                        $conds[] = 'rc_bot = 1';
                }
-               if ( $user->useRCPatrol() && $opts['hidepatrolled'] ) {
-                       $conds['rc_patrolled'] = 0;
+               if ( $user->useRCPatrol() ) {
+                       if ( $opts['hidepatrolled'] ) {
+                               $conds[] = 'rc_patrolled = 0';
+                       }
+                       if ( $opts['hideunpatrolled'] ) {
+                               $conds[] = 'rc_patrolled = 1';
+                       }
                }
                if ( $botsonly ) {
                        $conds['rc_bot'] = 1;
@@ -292,7 +312,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        $operator = $opts['invert'] ? '!=' : '=';
                        $boolean = $opts['invert'] ? 'AND' : 'OR';
 
-                       // Namespace association (bug 2429)
+                       // Namespace association (T4429)
                        if ( !$opts['associated'] ) {
                                $condition = "rc_namespace $operator $selectedNS";
                        } else {