r12340 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12339‎ | r12340 | r12341 >
Date:22:07, 1 January 2006
Author:timstarling
Status:old
Tags:
Comment:
$wgOut->setRevisionId() was missing from one branch out of 4, causing an incorrect edit link when editing an old revision which is a redirect. Moved the call outside the if structure.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -833,13 +833,13 @@
834834 * trigger when the parser cache is used.
835835 */
836836 wfRunHooks( 'ArticleViewHeader', array( &$this ) ) ;
 837+ $wgOut->setRevisionId( $this->getRevIdFetched() );
837838 # wrap user css and user js in pre and don't parse
838839 # XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found
839840 if (
840841 $this->mTitle->getNamespace() == NS_USER &&
841842 preg_match('/\\/[\\w]+\\.(css|js)$/', $this->mTitle->getDBkey())
842843 ) {
843 - $wgOut->setRevisionId( $this->getRevIdFetched() );
844844 $wgOut->addWikiText( wfMsg('clearyourcache'));
845845 $wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
846846 } else if ( $rt = Title::newFromRedirect( $text ) ) {
@@ -860,7 +860,6 @@
861861 $wgOut->addParserOutputNoText( $parseout );
862862 } else if ( $pcache ) {
863863 # Display content and save to parser cache
864 - $wgOut->setRevisionId( $this->getRevIdFetched() );
865864 $wgOut->addPrimaryWikiText( $text, $this );
866865 } else {
867866 # Display content, don't attempt to save to parser cache
@@ -869,7 +868,6 @@
870869 if( !$this->isCurrent() ) {
871870 $oldEditSectionSetting = $wgOut->mParserOptions->setEditSection( false );
872871 }
873 - $wgOut->setRevisionId( $this->getRevIdFetched() );
874872 $wgOut->addWikiText( $text );
875873
876874 if( !$this->isCurrent() ) {

Status & tagging log