r14633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14632‎ | r14633 | r14634 >
Date:08:28, 7 June 2006
Author:brion
Status:old
Tags:
Comment:
* Regression fix: suppress warning about session failure when clicking to
edit with 'preview on first edit' enabled.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -24,6 +24,7 @@
2525 var $firsttime;
2626 var $lastDelete;
2727 var $mTokenOk = false;
 28+ var $mTriedSave = false;
2829 var $tooBig = false;
2930 var $kblength = false;
3031 var $missingComment = false;
@@ -358,6 +359,10 @@
359360 $this->preview = $request->getCheck( 'wpPreview' ) || $request->getCheck( 'wpLivePreview' );
360361 $this->diff = $request->getCheck( 'wpDiff' );
361362
 363+ // Remember whether a save was requested, so we can indicate
 364+ // if we forced preview due to session failure.
 365+ $this->mTriedSave = !$this->preview;
 366+
362367 if ( $this->tokenOk( $request ) ) {
363368 # Some browsers will not report any submit button
364369 # if the user hits enter in the comment box.
@@ -1260,10 +1265,10 @@
12611266 $fname = 'EditPage::getPreviewText';
12621267 wfProfileIn( $fname );
12631268
1264 - if ( $this->mTokenOk ) {
 1269+ if ( $this->mTriedSave && !$this->mTokenOk ) {
 1270+ $msg = 'session_fail_preview';
 1271+ } else {
12651272 $msg = 'previewnote';
1266 - } else {
1267 - $msg = 'session_fail_preview';
12681273 }
12691274 $previewhead = '<h2>' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>\n" .
12701275 "<div class='previewnote'>" . $wgOut->parse( wfMsg( $msg ) ) . "</div>\n";
Index: trunk/phase3/RELEASE-NOTES
@@ -454,6 +454,8 @@
455455 meta robots tag on diff view and special pages. Should reduce impact of
456456 robots on scrolling special pages, diffs etc on sites where robots.txt
457457 doesn't forbid access.
 458+* Regression fix: suppress warning about session failure when clicking to
 459+ edit with 'preview on first edit' enabled.
458460
459461
460462 == Compatibility ==

Status & tagging log