Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -385,6 +385,13 @@ |
386 | 386 | wfProfileIn( __METHOD__ ); |
387 | 387 | wfDebug( __METHOD__.": enter\n" ); |
388 | 388 | |
| 389 | + // If they used redlink=1 and the page exists, redirect to the main article |
| 390 | + if ( $wgRequest->getBool( 'redlink' ) && $this->mTitle->exists() ) { |
| 391 | + $wgOut->redirect( $this->mTitle->getFullURL() ); |
| 392 | + wfProfileOut( __METHOD__ ); |
| 393 | + return; |
| 394 | + } |
| 395 | + |
389 | 396 | $this->importFormData( $wgRequest ); |
390 | 397 | $this->firsttime = false; |
391 | 398 | |
— | — | @@ -419,28 +426,23 @@ |
420 | 427 | $this->readOnlyPage( $content, true, $permErrors, 'edit' ); |
421 | 428 | wfProfileOut( __METHOD__ ); |
422 | 429 | return; |
423 | | - } else { |
424 | | - if ( $this->save ) { |
425 | | - $this->formtype = 'save'; |
426 | | - } elseif ( $this->preview ) { |
| 430 | + } |
| 431 | + |
| 432 | + if ( $this->save ) { |
| 433 | + $this->formtype = 'save'; |
| 434 | + } elseif ( $this->preview ) { |
| 435 | + $this->formtype = 'preview'; |
| 436 | + } elseif ( $this->diff ) { |
| 437 | + $this->formtype = 'diff'; |
| 438 | + } else { # First time through |
| 439 | + $this->firsttime = true; |
| 440 | + if ( $this->previewOnOpen() ) { |
427 | 441 | $this->formtype = 'preview'; |
428 | | - } elseif ( $this->diff ) { |
429 | | - $this->formtype = 'diff'; |
430 | | - } else { # First time through |
431 | | - $this->firsttime = true; |
432 | | - if ( $this->previewOnOpen() ) { |
433 | | - $this->formtype = 'preview'; |
434 | | - } else { |
435 | | - $this->formtype = 'initial'; |
436 | | - } |
| 442 | + } else { |
| 443 | + $this->formtype = 'initial'; |
437 | 444 | } |
438 | 445 | } |
439 | 446 | |
440 | | - // If they used redlink=1 and the page exists, redirect to the main article |
441 | | - if ( $wgRequest->getBool( 'redlink' ) && $this->mTitle->exists() ) { |
442 | | - $wgOut->redirect( $this->mTitle->getFullURL() ); |
443 | | - } |
444 | | - |
445 | 447 | wfProfileIn( __METHOD__."-business-end" ); |
446 | 448 | |
447 | 449 | $this->isConflict = false; |