From: Brion Vibber Date: Tue, 3 Jan 2006 23:32:39 +0000 (+0000) Subject: * (bug 4446) $wgExportAllowHistory option to explicitly disable history in X-Git-Tag: 1.6.0~780 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=bb17fe82a83e7c67e84663ffb260c8c12d35c7af;p=lhc%2Fweb%2Fwiklou.git * (bug 4446) $wgExportAllowHistory option to explicitly disable history in Special:Export form, 'exportnohistory' message to translate live hack. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cb6b1c1572..24d344de1d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e1ca6442a5..f0142eb011 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index c3df5e9244..f470fae79b 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -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 = "
"; + } else { + $checkbox = ""; + $wgOut->addWikiText( wfMsg( "exportnohistory" ) ); + } $wgOut->addHTML( "

-
+$checkbox
" ); diff --git a/languages/Language.php b/languages/Language.php index dadcb041ec..998485fe1a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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