From 0afe103e35a85e65041dbe793a63aadc26bb2e33 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 6 Dec 2003 04:27:16 +0000 Subject: [PATCH] Complain if use asks for page that's not archived --- includes/SpecialUndelete.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 3fda4d3017..bfd0e54980 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -64,6 +64,17 @@ function wfSpecialUndelete( $par ) $sk = $wgUser->getSkin(); $wgOut->setPagetitle( wfMsg( "undeletepage" ) ); + + $sql = "SELECT ar_minor_edit,ar_timestamp,ar_user,ar_user_text,ar_comment + FROM archive WHERE ar_namespace={$namespace} AND ar_title=\"{$title}\" + ORDER BY ar_timestamp DESC"; + $ret = wfQuery( $sql, DB_READ ); + + if( wfNumRows( $ret ) == 0 ) { + $wgOut->addWikiText( wfMsg( "nohistory" ) ); + return 0; + } + $wgOut->addWikiText( wfMsg( "undeletehistory" ) . "\n
\n" . $row->ar_text ); $action = wfLocalUrlE( $wgLang->specialPage( "Undelete" ), "action=submit" ); @@ -80,11 +91,6 @@ function wfSpecialUndelete( $par ) $wgOut->addWikiText( $m[1] ); } - $sql = "SELECT ar_minor_edit,ar_timestamp,ar_user,ar_user_text,ar_comment - FROM archive WHERE ar_namespace={$namespace} AND ar_title=\"{$title}\" - ORDER BY ar_timestamp DESC"; - $ret = wfQuery( $sql, DB_READ ); - $special = $wgLang->getNsText( Namespace::getSpecial() ); $wgOut->addHTML("