r47660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47659‎ | r47660 | r47661 >
Date:13:58, 22 February 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* 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
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -523,7 +523,7 @@
524524 } elseif ( $this->section == 'new' ) {
525525 // Nothing *to* preview for new sections
526526 return false;
527 - } elseif ( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
 527+ } elseif ( ( $wgRequest->getVal( 'preload' ) !== null || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
528528 // Standard preference behaviour
529529 return true;
530530 } elseif ( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) {
@@ -678,8 +678,16 @@
679679 if ( $this->suppressIntro ) {
680680 return;
681681 }
 682+
 683+ $namespace = $this->mTitle->getNamespace();
 684+
 685+ if ( $namespace == NS_MEDIAWIKI ) {
 686+ # Show a warning if editing an interface message
 687+ $wgOut->wrapWikiMsg( "<div class='mw-editinginterface'>\n$1</div>", 'editinginterface' );
 688+ }
 689+
682690 # Show a warning message when someone creates/edits a user (talk) page but the user does not exists
683 - if ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
 691+ if ( $namespace == NS_USER || $namespace == NS_USER_TALK ) {
684692 $parts = explode( '/', $this->mTitle->getText(), 2 );
685693 $username = $parts[0];
686694 $id = User::idFromName( $username );
@@ -1161,7 +1169,7 @@
11621170 }
11631171
11641172 if ( $this->missingComment ) {
1165 - $wgOut->wrapWikiMsg( '<div id="mw-missingcommenttext">$1</div>', 'missingcommenttext' );
 1173+ $wgOut->wrapWikiMsg( '<div id="mw-missingcommenttext">$1</div>', 'missingcommenttext' );
11661174 }
11671175
11681176 if ( $this->missingSummary && $this->section != 'new' ) {
@@ -1214,8 +1222,6 @@
12151223
12161224 $classes = array(); // Textarea CSS
12171225 if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
1218 - # Show a warning if editing an interface message
1219 - $wgOut->wrapWikiMsg( "<div class='mw-editinginterface'>\n$1</div>", 'editinginterface' );
12201226 } elseif ( $this->mTitle->isProtected( 'edit' ) ) {
12211227 # Is the title semi-protected?
12221228 if ( $this->mTitle->isSemiProtected() ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r24969Static code analysis housekeeping time... things that could be double-checked...nickj03:57, 21 August 2007

Status & tagging log