MediaWiki REL1_39
BadTitleError.php
Go to the documentation of this file.
1<?php
42 public function __construct( $msg = 'badtitletext', $params = [] ) {
43 if ( $msg instanceof MalformedTitleException ) {
44 $errorMessage = $msg->getErrorMessage();
45 if ( !$errorMessage ) {
46 parent::__construct( 'badtitle', 'badtitletext', [] );
47 } else {
48 $errorMessageParams = $msg->getErrorMessageParameters();
49 parent::__construct( 'badtitle', $errorMessage, $errorMessageParams );
50 }
51 } else {
52 parent::__construct( 'badtitle', $msg, $params );
53 }
54 }
55
59 public function report( $action = self::SEND_OUTPUT ) {
60 global $wgOut;
61 $wgOut->setStatusCode( 404 );
62 parent::report( $action );
63 }
64}
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode $wgOut
Definition Setup.php:497
Show an error page on a badtitle.
__construct( $msg='badtitletext', $params=[])
report( $action=self::SEND_OUTPUT)
to override
An error page which can definitely be safely rendered using the OutputPage.
MalformedTitleException is thrown when a TitleParser is unable to parse a title string.