From: Brion Vibber Date: Sat, 6 Dec 2003 04:27:16 +0000 (+0000) Subject: Complain if use asks for page that's not archived X-Git-Tag: 1.1.0~12 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=0afe103e35a85e65041dbe793a63aadc26bb2e33;p=lhc%2Fweb%2Fwiklou.git Complain if use asks for page that's not archived --- 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("