Code Duplication    Length = 19-21 lines in 2 locations

includes/api/ApiQueryRecentChanges.php 1 location

@@ 460-478 (lines=19) @@
457
		}
458
459
		/* Add user data and 'anon' flag, if user is anonymous. */
460
		if ( $this->fld_user || $this->fld_userid ) {
461
			if ( $row->rc_deleted & Revision::DELETED_USER ) {
462
				$vals['userhidden'] = true;
463
				$anyHidden = true;
464
			}
465
			if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_USER, $user ) ) {
466
				if ( $this->fld_user ) {
467
					$vals['user'] = $row->rc_user_text;
468
				}
469
470
				if ( $this->fld_userid ) {
471
					$vals['userid'] = (int)$row->rc_user;
472
				}
473
474
				if ( !$row->rc_user ) {
475
					$vals['anon'] = true;
476
				}
477
			}
478
		}
479
480
		/* Add flags, such as new, minor, bot. */
481
		if ( $this->fld_flags ) {

includes/api/ApiQueryWatchlist.php 1 location

@@ 331-351 (lines=21) @@
328
		}
329
330
		/* Add user data and 'anon' flag, if user is anonymous. */
331
		if ( $this->fld_user || $this->fld_userid ) {
332
			if ( $row->rc_deleted & Revision::DELETED_USER ) {
333
				$vals['userhidden'] = true;
334
				$anyHidden = true;
335
			}
336
			if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_USER, $user ) ) {
337
				if ( $this->fld_userid ) {
338
					$vals['userid'] = (int)$row->rc_user;
339
					// for backwards compatibility
340
					$vals['user'] = (int)$row->rc_user;
341
				}
342
343
				if ( $this->fld_user ) {
344
					$vals['user'] = $row->rc_user_text;
345
				}
346
347
				if ( !$row->rc_user ) {
348
					$vals['anon'] = true;
349
				}
350
			}
351
		}
352
353
		/* Add flags, such as new, minor, bot. */
354
		if ( $this->fld_flags ) {