* (bug 4446) $wgExportAllowHistory option to explicitly disable history in
Special:Export form, 'exportnohistory' message to translate live hack.
This commit is contained in:
parent
ad94d11a2c
commit
bb17fe82a8
4 changed files with 24 additions and 3 deletions
|
|
@ -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 ===
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
" );
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue