Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -498,8 +498,16 @@ |
499 | 499 | { |
500 | 500 | $nofile = 'filepage-nofile'; |
501 | 501 | } |
| 502 | + // Note, if there is an image description page, but |
| 503 | + // no image, then this setRobotPolicy is overriden |
| 504 | + // by Article::View(). |
502 | 505 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
503 | 506 | $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 | + } |
504 | 512 | } |
505 | 513 | } |
506 | 514 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -82,6 +82,8 @@ |
83 | 83 | * (bug 26733) Wrap initial table creation in transaction |
84 | 84 | * (bug 26729) Category pages should return 404 if they do not exist and have no |
85 | 85 | members. |
| 86 | +* (bug 2585) Image pages should send 404 if no image, no shared image and no |
| 87 | + description page. |
86 | 88 | |
87 | 89 | === API changes in 1.18 === |
88 | 90 | * (bug 26339) Throw warning when truncating an overlarge API result |