Code Duplication    Length = 8-11 lines in 2 locations

includes/api/ApiQueryRecentChanges.php 1 location

@@ 203-213 (lines=11) @@
200
			}
201
202
			// Check permissions
203
			if ( isset( $show['patrolled'] )
204
				|| isset( $show['!patrolled'] )
205
				|| isset( $show['unpatrolled'] )
206
			) {
207
				if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
208
					$this->dieUsage(
209
						'You need patrol or patrolmarks permission to request the patrolled flag',
210
						'permissiondenied'
211
					);
212
				}
213
			}
214
215
			/* Add additional conditions to query depending upon parameters. */
216
			$this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );

includes/api/ApiQueryWatchlist.php 1 location

@@ 177-184 (lines=8) @@
174
			}
175
176
			// Check permissions.
177
			if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) {
178
				if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
179
					$this->dieUsage(
180
						'You need the patrol right to request the patrolled flag',
181
						'permissiondenied'
182
					);
183
				}
184
			}
185
186
			/* Add additional conditions to query depending upon parameters. */
187
			$this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );