Code Duplication    Length = 24-25 lines in 2 locations

includes/specials/SpecialUndelete.php 2 locations

@@ 1666-1689 (lines=24) @@
1663
	 * @param string $ts Timestamp
1664
	 * @return string
1665
	 */
1666
	function getPageLink( $rev, $titleObj, $ts ) {
1667
		$user = $this->getUser();
1668
		$time = $this->getLanguage()->userTimeAndDate( $ts, $user );
1669
1670
		if ( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) {
1671
			return '<span class="history-deleted">' . $time . '</span>';
1672
		}
1673
1674
		$link = Linker::linkKnown(
1675
			$titleObj,
1676
			htmlspecialchars( $time ),
1677
			[],
1678
			[
1679
				'target' => $this->mTargetObj->getPrefixedText(),
1680
				'timestamp' => $ts
1681
			]
1682
		);
1683
1684
		if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
1685
			$link = '<span class="history-deleted">' . $link . '</span>';
1686
		}
1687
1688
		return $link;
1689
	}
1690
1691
	/**
1692
	 * Fetch image view link if it's available to all users
@@ 1701-1725 (lines=25) @@
1698
	 *
1699
	 * @return string HTML fragment
1700
	 */
1701
	function getFileLink( $file, $titleObj, $ts, $key ) {
1702
		$user = $this->getUser();
1703
		$time = $this->getLanguage()->userTimeAndDate( $ts, $user );
1704
1705
		if ( !$file->userCan( File::DELETED_FILE, $user ) ) {
1706
			return '<span class="history-deleted">' . $time . '</span>';
1707
		}
1708
1709
		$link = Linker::linkKnown(
1710
			$titleObj,
1711
			htmlspecialchars( $time ),
1712
			[],
1713
			[
1714
				'target' => $this->mTargetObj->getPrefixedText(),
1715
				'file' => $key,
1716
				'token' => $user->getEditToken( $key )
1717
			]
1718
		);
1719
1720
		if ( $file->isDeleted( File::DELETED_FILE ) ) {
1721
			$link = '<span class="history-deleted">' . $link . '</span>';
1722
		}
1723
1724
		return $link;
1725
	}
1726
1727
	/**
1728
	 * Fetch file's user id if it's available to this user