r67762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67761‎ | r67762 | r67763 >
Date:21:09, 9 June 2010
Author:hartman
Status:ok
Tags:
Comment:
Bug 23851. Repair diff views for FILE pages that are redirects.

Diffs for FILE redirects will force diffonly == true because otherwise full images
are included into the rendering by DiffEngine.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -61,12 +61,21 @@
6262
6363 public function view() {
6464 global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
 65+
 66+ $diff = $wgRequest->getVal( 'diff' );
 67+ $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
 68+
 69+ if ( $this->mTitle->getNamespace() != NS_FILE || ( isset( $diff ) && $diffOnly ) ) {
 70+ return Article::view();
 71+ }
 72+
6573 $this->loadFile();
6674
6775 if ( $this->mTitle->getNamespace() == NS_FILE && $this->img->getRedirected() ) {
68 - if ( $this->mTitle->getDBkey() == $this->img->getName() ) {
 76+ if ( $this->mTitle->getDBkey() == $this->img->getName() || isset( $diff ) ) {
6977 // mTitle is the same as the redirect target so ask Article
7078 // to perform the redirect for us.
 79+ $wgRequest->setVal( 'diffonly', 'true' );
7180 return Article::view();
7281 } else {
7382 // mTitle is not the same as the redirect target so it is
@@ -79,12 +88,6 @@
8089 }
8190 }
8291
83 - $diff = $wgRequest->getVal( 'diff' );
84 - $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
85 -
86 - if ( $this->mTitle->getNamespace() != NS_FILE || ( isset( $diff ) && $diffOnly ) )
87 - return Article::view();
88 -
8992 $this->showRedirectedFromHeader();
9093
9194 if ( $wgShowEXIF && $this->displayImg->exists() ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -213,6 +213,7 @@
214214 * (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when
215215 thumbnailing larger than original image
216216 * (bug 23835) Need "thumbmime" result in "imageinfo" query
 217+* (bug 23851) Repair diff for file redirect pages
217218
218219 === Languages updated in 1.17 ===
219220

Status & tagging log