Code Duplication    Length = 7-9 lines in 2 locations

includes/logging/LogEventsList.php 1 location

@@ 432-440 (lines=9) @@
429
				// Show checkboxes instead of links.
430
				if ( $canHide && $this->flags & self::USE_CHECKBOXES && !$canViewThisSuppressedEntry ) {
431
					// If event was hidden from sysops
432
					if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
433
						$del = Xml::check( 'deleterevisions', false, [ 'disabled' => 'disabled' ] );
434
					} else {
435
						$del = Xml::check(
436
							'showhiderevisions',
437
							false,
438
							[ 'name' => 'ids[' . $row->log_id . ']' ]
439
						);
440
					}
441
				} else {
442
					// If event was hidden from sysops
443
					if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {

includes/actions/HistoryAction.php 1 location

@@ 657-663 (lines=7) @@
654
			$this->preventClickjacking();
655
			// If revision was hidden from sysops and we don't need the checkbox
656
			// for anything else, disable it
657
			if ( !$this->showTagEditUI && !$rev->userCan( Revision::DELETED_RESTRICTED, $user ) ) {
658
				$del = Xml::check( 'deleterevisions', false, [ 'disabled' => 'disabled' ] );
659
			// Otherwise, enable the checkbox...
660
			} else {
661
				$del = Xml::check( 'showhiderevisions', false,
662
					[ 'name' => 'ids[' . $rev->getId() . ']' ] );
663
			}
664
		// User can only view deleted revisions...
665
		} elseif ( $rev->getVisibility() && $user->isAllowed( 'deletedhistory' ) ) {
666
			// If revision was hidden from sysops, disable the link