Code Duplication    Length = 13-13 lines in 2 locations

includes/api/ApiQueryAllRevisions.php 1 location

@@ 133-145 (lines=13) @@
130
			}
131
		}
132
133
		if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
134
			// Paranoia: avoid brute force searches (bug 17342)
135
			if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) {
136
				$bitmask = Revision::DELETED_USER;
137
			} elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
138
				$bitmask = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
139
			} else {
140
				$bitmask = 0;
141
			}
142
			if ( $bitmask ) {
143
				$this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
144
			}
145
		}
146
147
		if ( $params['continue'] !== null ) {
148
			$op = ( $dir == 'newer' ? '>' : '<' );

includes/api/ApiQueryRevisions.php 1 location

@@ 254-266 (lines=13) @@
251
						$db->addQuotes( $params['excludeuser'] ) );
252
				}
253
			}
254
			if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
255
				// Paranoia: avoid brute force searches (bug 17342)
256
				if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) {
257
					$bitmask = Revision::DELETED_USER;
258
				} elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
259
					$bitmask = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
260
				} else {
261
					$bitmask = 0;
262
				}
263
				if ( $bitmask ) {
264
					$this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
265
				}
266
			}
267
		} elseif ( $revCount > 0 ) {
268
			// Always targets the PRIMARY index
269