From: Niklas Laxström Date: Sun, 22 Feb 2009 13:58:42 +0000 (+0000) Subject: * Fix broken since added in r24969 preload check which forced forced preview being... X-Git-Tag: 1.31.0-rc.0~42726 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=25a0b5503fbe17a34efc6970e2d70ab66efecfec;p=lhc%2Fweb%2Fwiklou.git * Fix broken since added in r24969 preload check which forced forced preview being always true * Move interface warning to intro so that it can be suppressed --- diff --git a/includes/EditPage.php b/includes/EditPage.php index fafc0ee453..4163a127a8 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -523,7 +523,7 @@ class EditPage { } elseif ( $this->section == 'new' ) { // Nothing *to* preview for new sections return false; - } elseif ( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) { + } elseif ( ( $wgRequest->getVal( 'preload' ) !== null || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) { // Standard preference behaviour return true; } elseif ( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) { @@ -678,8 +678,16 @@ class EditPage { if ( $this->suppressIntro ) { return; } + + $namespace = $this->mTitle->getNamespace(); + + if ( $namespace == NS_MEDIAWIKI ) { + # Show a warning if editing an interface message + $wgOut->wrapWikiMsg( "
\n$1
", 'editinginterface' ); + } + # Show a warning message when someone creates/edits a user (talk) page but the user does not exists - if ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) { + if ( $namespace == NS_USER || $namespace == NS_USER_TALK ) { $parts = explode( '/', $this->mTitle->getText(), 2 ); $username = $parts[0]; $id = User::idFromName( $username ); @@ -1161,7 +1169,7 @@ class EditPage { } if ( $this->missingComment ) { - $wgOut->wrapWikiMsg( '
$1
', 'missingcommenttext' ); + $wgOut->wrapWikiMsg( '
$1
', 'missingcommenttext' ); } if ( $this->missingSummary && $this->section != 'new' ) { @@ -1214,8 +1222,6 @@ class EditPage { $classes = array(); // Textarea CSS if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { - # Show a warning if editing an interface message - $wgOut->wrapWikiMsg( "
\n$1
", 'editinginterface' ); } elseif ( $this->mTitle->isProtected( 'edit' ) ) { # Is the title semi-protected? if ( $this->mTitle->isSemiProtected() ) {