- public function doMarkPatrolled( User $user, $auto = false ) {
- global $wgUseRCPatrol, $wgUseNPPatrol;
- $errors = array();
- // If recentchanges patrol is disabled, only new pages
- // can be patrolled
- if ( !$wgUseRCPatrol && ( !$wgUseNPPatrol || $this->getAttribute( 'rc_type' ) != RC_NEW ) ) {
- $errors[] = array( 'rcpatroldisabled' );
+ public function doMarkPatrolled( User $user, $auto = false, $tags = null ) {
+ global $wgUseRCPatrol, $wgUseNPPatrol, $wgUseFilePatrol;
+ $errors = [];
+ // If recentchanges patrol is disabled, only new pages or new file versions
+ // can be patrolled, provided the appropriate config variable is set
+ if ( !$wgUseRCPatrol && ( !$wgUseNPPatrol || $this->getAttribute( 'rc_type' ) != RC_NEW ) &&
+ ( !$wgUseFilePatrol || !( $this->getAttribute( 'rc_type' ) == RC_LOG &&
+ $this->getAttribute( 'rc_log_type' ) == 'upload' ) ) ) {
+ $errors[] = [ 'rcpatroldisabled' ];