X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdiff%2FDifferenceEngine.php;h=3846473a59e62b383747df7b264eff7370c274e0;hb=b0cb8e159236e8e57edcc36f0f1dfb303a5acf11;hp=db3c37c3da871e733eb876729e9ad7de1488deea;hpb=822a34bc3c6e5c6260e724a74869497d575f94ac;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index db3c37c3da..3846473a59 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -179,6 +179,22 @@ class DifferenceEngine extends ContextSource { } } + private function showMissingRevision() { + $out = $this->getOutput(); + + $missing = array(); + if ( $this->mOldRev === null ) { + $missing[] = $this->deletedIdMarker( $this->mOldid ); + } + if ( $this->mNewRev === null ) { + $missing[] = $this->deletedIdMarker( $this->mNewid ); + } + + $out->setPageTitle( $this->msg( 'errorpagetitle' ) ); + $out->addWikiMsg( 'difference-missing-revision', + $this->getLanguage()->listToText( $missing ), count( $missing ) ); + } + function showDiffPage( $diffOnly = false ) { wfProfileIn( __METHOD__ ); @@ -188,13 +204,7 @@ class DifferenceEngine extends ContextSource { $out->setRobotPolicy( 'noindex,nofollow' ); if ( !$this->loadRevisionData() ) { - // Sounds like a deleted revision... Let's see what we can do. - $t = $this->getTitle()->getPrefixedText(); - $d = $this->msg( 'missingarticle-diff', - $this->deletedIdMarker( $this->mOldid ), - $this->deletedIdMarker( $this->mNewid ) )->escaped(); - $out->setPageTitle( $this->msg( 'errorpagetitle' ) ); - $out->addWikiMsg( 'missing-article', "$t", "$d" ); + $this->showMissingRevision(); wfProfileOut( __METHOD__ ); return; } @@ -557,7 +567,7 @@ class DifferenceEngine extends ContextSource { function showDiff( $otitle, $ntitle, $notice = '' ) { $diff = $this->getDiff( $otitle, $ntitle, $notice ); if ( $diff === false ) { - $this->getOutput()->addWikiMsg( 'missing-article', "(fixme, bug)", '' ); + $this->showMissingRevision(); return false; } else { $this->showDiffStyle(); @@ -907,7 +917,7 @@ class DifferenceEngine extends ContextSource { if ( !$diff && !$otitle ) { $header .= " - + {$ntitle} "; $multiColspan = 1; @@ -925,17 +935,17 @@ class DifferenceEngine extends ContextSource { $multiColspan = 2; } $header .= " - + {$otitle} {$ntitle} "; } if ( $multi != '' ) { - $header .= "{$multi}"; + $header .= "{$multi}"; } if ( $notice != '' ) { - $header .= "{$notice}"; + $header .= "{$notice}"; } return $header . $diff . ""; @@ -1020,7 +1030,7 @@ class DifferenceEngine extends ContextSource { // Load the new revision object $this->mNewRev = $this->mNewid ? Revision::newFromId( $this->mNewid ) - : Revision::newFromTitle( $this->getTitle(), false, Revision::AVOID_MASTER ); + : Revision::newFromTitle( $this->getTitle(), false, Revision::READ_NORMAL ); if ( !$this->mNewRev instanceof Revision ) { return false;