r80407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80406‎ | r80407 | r80408 >
Date:00:43, 16 January 2011
Author:bawolff
Status:ok (Comments)
Tags:brion 
Comment:

(bug 2585) Image pages should send 404 if no image, no shared image and no
description page (To be consistant with how non-existant article pages act).
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -498,8 +498,16 @@
499499 {
500500 $nofile = 'filepage-nofile';
501501 }
 502+ // Note, if there is an image description page, but
 503+ // no image, then this setRobotPolicy is overriden
 504+ // by Article::View().
502505 $wgOut->setRobotPolicy( 'noindex,nofollow' );
503506 $wgOut->wrapWikiMsg( "<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
 507+ if ( !$this->getID() ) {
 508+ // If there is no image, no shared image, and no description page,
 509+ // output a 404, to be consistent with articles.
 510+ $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
 511+ }
504512 }
505513 }
506514
Index: trunk/phase3/RELEASE-NOTES
@@ -82,6 +82,8 @@
8383 * (bug 26733) Wrap initial table creation in transaction
8484 * (bug 26729) Category pages should return 404 if they do not exist and have no
8585 members.
 86+* (bug 2585) Image pages should send 404 if no image, no shared image and no
 87+ description page.
8688
8789 === API changes in 1.18 ===
8890 * (bug 26339) Throw warning when truncating an overlarge API result

Sign-offs

UserFlagDate
Hasharinspected09:57, 5 June 2011

Comments

#Comment by Hashar (talk | contribs)   09:57, 5 June 2011

tagging for review by Brion. I know he loves HTTP error codes.

Status & tagging log