From 4965776c814f1eb96d540570ee328988f95ca235 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 28 Oct 2008 13:42:05 +0000 Subject: [PATCH] Move getEarliestTime() to Title --- includes/Title.php | 17 +++++++++++++++++ includes/specials/SpecialUndelete.php | 14 +------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 42fc685c80..53ba1d05da 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3020,6 +3020,23 @@ class Title { ); } + /** + * Get the oldest revision timestamp of this page + * + * @return string, MW timestamp + */ + public function getEarliestRevTime() { + $dbr = wfGetDB( DB_SLAVE ); + if( $this->exists() ) { + $min = $dbr->selectField( 'revision', + 'MIN(rev_timestamp)', + array( 'rev_page' => $this->getArticleId() ), + __METHOD__ ); + return wfTimestampOrNull( TS_MW, $min ); + } + return null; + } + /** * Get the number of revisions between the given revision IDs. * Used for diffs and other things that really need it. diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index a26d27e16d..9152076c83 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -1033,7 +1033,7 @@ class UndeleteForm { $wgOut->addHTML("