Code Duplication    Length = 24-25 lines in 2 locations

includes/specials/SpecialUndelete.php 2 locations

@@ 1593-1616 (lines=24) @@
1590
	 * @param string $ts Timestamp
1591
	 * @return string
1592
	 */
1593
	function getPageLink( $rev, $titleObj, $ts ) {
1594
		$user = $this->getUser();
1595
		$time = $this->getLanguage()->userTimeAndDate( $ts, $user );
1596
1597
		if ( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) {
1598
			return '<span class="history-deleted">' . $time . '</span>';
1599
		}
1600
1601
		$link = Linker::linkKnown(
1602
			$titleObj,
1603
			htmlspecialchars( $time ),
1604
			[],
1605
			[
1606
				'target' => $this->mTargetObj->getPrefixedText(),
1607
				'timestamp' => $ts
1608
			]
1609
		);
1610
1611
		if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
1612
			$link = '<span class="history-deleted">' . $link . '</span>';
1613
		}
1614
1615
		return $link;
1616
	}
1617
1618
	/**
1619
	 * Fetch image view link if it's available to all users
@@ 1628-1652 (lines=25) @@
1625
	 *
1626
	 * @return string HTML fragment
1627
	 */
1628
	function getFileLink( $file, $titleObj, $ts, $key ) {
1629
		$user = $this->getUser();
1630
		$time = $this->getLanguage()->userTimeAndDate( $ts, $user );
1631
1632
		if ( !$file->userCan( File::DELETED_FILE, $user ) ) {
1633
			return '<span class="history-deleted">' . $time . '</span>';
1634
		}
1635
1636
		$link = Linker::linkKnown(
1637
			$titleObj,
1638
			htmlspecialchars( $time ),
1639
			[],
1640
			[
1641
				'target' => $this->mTargetObj->getPrefixedText(),
1642
				'file' => $key,
1643
				'token' => $user->getEditToken( $key )
1644
			]
1645
		);
1646
1647
		if ( $file->isDeleted( File::DELETED_FILE ) ) {
1648
			$link = '<span class="history-deleted">' . $link . '</span>';
1649
		}
1650
1651
		return $link;
1652
	}
1653
1654
	/**
1655
	 * Fetch file's user id if it's available to this user