Code Duplication    Length = 15-21 lines in 3 locations

includes/api/ApiQueryRecentChanges.php 1 location

@@ 499-513 (lines=15) @@
496
		}
497
498
		/* Add edit summary / log summary. */
499
		if ( $this->fld_comment || $this->fld_parsedcomment ) {
500
			if ( $row->rc_deleted & Revision::DELETED_COMMENT ) {
501
				$vals['commenthidden'] = true;
502
				$anyHidden = true;
503
			}
504
			if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_COMMENT, $user ) ) {
505
				if ( $this->fld_comment && isset( $row->rc_comment ) ) {
506
					$vals['comment'] = $row->rc_comment;
507
				}
508
509
				if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
510
					$vals['parsedcomment'] = Linker::formatComment( $row->rc_comment, $title );
511
				}
512
			}
513
		}
514
515
		if ( $this->fld_redirect ) {
516
			$vals['redirect'] = (bool)$row->page_is_redirect;

includes/api/ApiQueryUserContributions.php 1 location

@@ 374-394 (lines=21) @@
371
			$vals['top'] = $row->page_latest == $row->rev_id;
372
		}
373
374
		if ( ( $this->fld_comment || $this->fld_parsedcomment ) && isset( $row->rev_comment ) ) {
375
			if ( $row->rev_deleted & Revision::DELETED_COMMENT ) {
376
				$vals['commenthidden'] = true;
377
				$anyHidden = true;
378
			}
379
380
			$userCanView = Revision::userCanBitfield(
381
				$row->rev_deleted,
382
				Revision::DELETED_COMMENT, $this->getUser()
383
			);
384
385
			if ( $userCanView ) {
386
				if ( $this->fld_comment ) {
387
					$vals['comment'] = $row->rev_comment;
388
				}
389
390
				if ( $this->fld_parsedcomment ) {
391
					$vals['parsedcomment'] = Linker::formatComment( $row->rev_comment, $title );
392
				}
393
			}
394
		}
395
396
		if ( $this->fld_patrolled ) {
397
			$vals['patrolled'] = (bool)$row->rc_patrolled;

includes/api/ApiQueryWatchlist.php 1 location

@@ 378-392 (lines=15) @@
375
		}
376
377
		/* Add edit summary / log summary. */
378
		if ( $this->fld_comment || $this->fld_parsedcomment ) {
379
			if ( $row->rc_deleted & Revision::DELETED_COMMENT ) {
380
				$vals['commenthidden'] = true;
381
				$anyHidden = true;
382
			}
383
			if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_COMMENT, $user ) ) {
384
				if ( $this->fld_comment && isset( $row->rc_comment ) ) {
385
					$vals['comment'] = $row->rc_comment;
386
				}
387
388
				if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
389
					$vals['parsedcomment'] = Linker::formatComment( $row->rc_comment, $title );
390
				}
391
			}
392
		}
393
394
		/* Add the patrolled flag */
395
		if ( $this->fld_patrol ) {