From: Andrew Garrett Date: Fri, 21 Mar 2008 08:51:16 +0000 (+0000) Subject: * Disallow deletion of big pages by means of moving a page to its title and using the X-Git-Tag: 1.31.0-rc.0~48901 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=7ad48aec39f9952db59cc56cbea1860b22b9099d;p=lhc%2Fweb%2Fwiklou.git * Disallow deletion of big pages by means of moving a page to its title and using the "delete and move" option. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cfa8208c55..99cd5e2210 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -110,6 +110,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13429) Separate date and time in message sp-newimages-showfrom * (bug 13137) Allow setting 'editprotected' right separately from 'protect', so groups may optionally edit protected pages without having 'protect' perms +* Disallow deletion of big pages by means of moving a page to its title and using the + "delete and move" option. === API changes in 1.13 === diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 8addbd62ed..4e844e83f7 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -138,6 +138,8 @@ class MovePageForm { $errMsg = ""; if( $err == 'hookaborted' ) { $errMsg = "

$hookErr

\n"; + } else if (is_array($err)) { + $errMsg = '

' . call_user_func_array( 'wfMsgWikiHtml', $err ) . "

\n"; } else { $errMsg = '

' . wfMsgWikiHtml( $err ) . "

\n"; } @@ -233,6 +235,15 @@ class MovePageForm { # Delete to make way if requested if ( $wgUser->isAllowed( 'delete' ) && $this->deleteAndMove ) { $article = new Article( $nt ); + + # Disallow deletions of big articles + $bigHistory = $article->isBigDeletion(); + if( $bigHistory && !$nt->userCan( 'bigdelete' ) ) { + global $wgLang, $wgDeleteRevisionsLimit; + $this->showForm( array('delete-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) ); + return; + } + // This may output an error message and exit $article->doDelete( wfMsgForContent( 'delete_and_move_reason' ) ); }