Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | var $firsttime; |
26 | 26 | var $lastDelete; |
27 | 27 | var $mTokenOk = false; |
| 28 | + var $mTriedSave = false; |
28 | 29 | var $tooBig = false; |
29 | 30 | var $kblength = false; |
30 | 31 | var $missingComment = false; |
— | — | @@ -358,6 +359,10 @@ |
359 | 360 | $this->preview = $request->getCheck( 'wpPreview' ) || $request->getCheck( 'wpLivePreview' ); |
360 | 361 | $this->diff = $request->getCheck( 'wpDiff' ); |
361 | 362 | |
| 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 | + |
362 | 367 | if ( $this->tokenOk( $request ) ) { |
363 | 368 | # Some browsers will not report any submit button |
364 | 369 | # if the user hits enter in the comment box. |
— | — | @@ -1260,10 +1265,10 @@ |
1261 | 1266 | $fname = 'EditPage::getPreviewText'; |
1262 | 1267 | wfProfileIn( $fname ); |
1263 | 1268 | |
1264 | | - if ( $this->mTokenOk ) { |
| 1269 | + if ( $this->mTriedSave && !$this->mTokenOk ) { |
| 1270 | + $msg = 'session_fail_preview'; |
| 1271 | + } else { |
1265 | 1272 | $msg = 'previewnote'; |
1266 | | - } else { |
1267 | | - $msg = 'session_fail_preview'; |
1268 | 1273 | } |
1269 | 1274 | $previewhead = '<h2>' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>\n" . |
1270 | 1275 | "<div class='previewnote'>" . $wgOut->parse( wfMsg( $msg ) ) . "</div>\n"; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -454,6 +454,8 @@ |
455 | 455 | meta robots tag on diff view and special pages. Should reduce impact of |
456 | 456 | robots on scrolling special pages, diffs etc on sites where robots.txt |
457 | 457 | doesn't forbid access. |
| 458 | +* Regression fix: suppress warning about session failure when clicking to |
| 459 | + edit with 'preview on first edit' enabled. |
458 | 460 | |
459 | 461 | |
460 | 462 | == Compatibility == |