r48915 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48914‎ | r48915 | r48916 >
Date:12:38, 27 March 2009
Author:jojo
Status:ok
Tags:
Comment:
show error page if download is a 404
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.i18n.php
@@ -130,6 +130,8 @@
131131 * Not satisfied with the output? See [[{{MediaWiki:Coll-helppage}}|the help page about books]] for possibilities to improve it.",
132132 'coll-notfound_title' => 'Book not found',
133133 'coll-notfound_text' => 'Could not find book page.',
 134+ 'coll-download_notfound_title' => 'File not found',
 135+ 'coll-download_notfound_text' => 'The file you are trying to download does not exist: Maybe it has been deleted and needs to be regenerated.',
134136 'coll-is_cached' => '<ul><li>A cached version of the document has been found, so no rendering was necessary. <a href="$1">Force re-rendering.</a></li></ul>',
135137 'coll-excluded-templates' => '* Templates in category [[:Category:$1|$1]] have been excluded.',
136138 'coll-blacklisted-templates' => '* Templates on blacklist [[:$1]] have been excluded.',
Index: trunk/extensions/Collection/Collection.body.php
@@ -874,6 +874,10 @@
875875 'collection_id' => $wgRequest->getVal( 'collection_id' ),
876876 'writer' => $wgRequest->getVal( 'writer' ),
877877 ), $timeout=false, $toFile=$tempfile );
 878+ if (!$headers) {
 879+ $wgOut->showErrorPage( 'coll-download_notfound_title', 'coll-download_notfound_text' );
 880+ return;
 881+ }
878882 wfResetOutputBuffers();
879883 if ( isset( $headers['content-type'] ) ) {
880884 header( 'Content-Type: ' . $headers['content-type']);

Status & tagging log