* Disallow deletion of big pages by means of moving a page to its title and using the
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 21 Mar 2008 08:51:16 +0000 (08:51 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 21 Mar 2008 08:51:16 +0000 (08:51 +0000)
  "delete and move" option.

RELEASE-NOTES
includes/SpecialMovepage.php

index cfa8208..99cd5e2 100644 (file)
@@ -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 ===
index 8addbd6..4e844e8 100644 (file)
@@ -138,6 +138,8 @@ class MovePageForm {
                        $errMsg = "";
                        if( $err == 'hookaborted' ) {
                                $errMsg = "<p><strong class=\"error\">$hookErr</strong></p>\n";
+                       } else if (is_array($err)) {
+                               $errMsg = '<p><strong class="error">' . call_user_func_array( 'wfMsgWikiHtml', $err ) . "</strong></p>\n";
                        } else {
                                $errMsg = '<p><strong class="error">' . wfMsgWikiHtml( $err ) . "</strong></p>\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' ) );
                }