* (bug 4446) $wgExportAllowHistory option to explicitly disable history in
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 3 Jan 2006 23:32:39 +0000 (23:32 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 3 Jan 2006 23:32:39 +0000 (23:32 +0000)
  Special:Export form, 'exportnohistory' message to translate live hack.

RELEASE-NOTES
includes/DefaultSettings.php
includes/SpecialExport.php
languages/Language.php

index cb6b1c1..24d344d 100644 (file)
@@ -401,6 +401,8 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 4456) Add hook for marking article patrolled
 * (bug 3194) default implementation of translateBlockExpiry
   which uses ipboptions
+* (bug 4446) $wgExportAllowHistory option to explicitly disable history in
+  Special:Export form, 'exportnohistory' message to translate live hack.
 
 
 === Caveats ===
index e1ca644..f0142eb 100644 (file)
@@ -1321,6 +1321,12 @@ $wgCapitalLinks = true;
  */
 $wgImportSources = array();
 
+/**
+ * If set to false, disables the full-history option on Special:Export.
+ * This is currently poorly optimized for long edit histories, so is
+ * disabled on Wikimedia's sites.
+ */
+$wgExportAllowHistory = true;
 
 
 /** Text matching this regular expression will be recognised as spam
index c3df5e9..f470fae 100644 (file)
@@ -31,10 +31,15 @@ require_once( 'Export.php' );
  */
 function wfSpecialExport( $page = '' ) {
        global $wgOut, $wgRequest;
+       global $wgExportAllowHistory;
        
        if( $wgRequest->getVal( 'action' ) == 'submit') {
                $page = $wgRequest->getText( 'pages' );
-               $curonly = $wgRequest->getCheck( 'curonly' );
+               if( $wgExportAllowHistory ) {
+                       $curonly = $wgRequest->getCheck( 'curonly' );
+               } else {
+                       $curonly = true;
+               }
        } else {
                # Pre-check the 'current version only' box in the UI
                $curonly = true;
@@ -57,12 +62,18 @@ function wfSpecialExport( $page = '' ) {
        $wgOut->addWikiText( wfMsg( "exporttext" ) );
        $titleObj = Title::makeTitle( NS_SPECIAL, "Export" );
        $action = $titleObj->escapeLocalURL( 'action=submit' );
+       if( $wgExportAllowHistory ) {
+               $checkbox = "<label><input type='checkbox' name='curonly' value='true' checked='checked' />
+" . wfMsgHtml( 'exportcuronly' ) . "</label><br />";
+       } else {
+               $checkbox = "";
+               $wgOut->addWikiText( wfMsg( "exportnohistory" ) );
+       }
        $wgOut->addHTML( "
 <form method='post' action=\"$action\">
 <input type='hidden' name='action' value='submit' />
 <textarea name='pages' cols='40' rows='10'></textarea><br />
-<label><input type='checkbox' name='curonly' value='true' checked='checked' />
-" . wfMsgHtml( 'exportcuronly' ) . "</label><br />
+$checkbox
 <input type='submit' />
 </form>
 " );
index dadcb04..998485f 100644 (file)
@@ -1611,6 +1611,8 @@ history lines, or just the current version with the info about the last edit.
 
 In the latter case you can also use a link, e.g. [[{{ns:Special}}:Export/{{Mediawiki:mainpage}}]] for the page {{Mediawiki:mainpage}}.',
 'exportcuronly'        => 'Include only the current revision, not the full history',
+'exportnohistory' => "----
+'''Note:''' exporting the full history of pages through this form has been disabled due to performance reasons.",
 
 # Namespace 8 related