MediaWiki
REL1_40
BadTitleError.php
Go to the documentation of this file.
1
<?php
34
class
BadTitleError
extends
ErrorPageError
{
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
62
$wgOut
->setStatusCode( 404 );
63
64
parent::report( self::STAGE_OUTPUT );
65
66
// Unconditionally cache the error for an hour, see T316932
67
$wgOut
->enableClientCache();
68
$wgOut
->setCdnMaxage( 3600 );
69
70
if
( $action === self::SEND_OUTPUT ) {
71
$wgOut
->output();
72
}
73
}
74
}
$wgOut
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode $wgOut
Definition
Setup.php:527
BadTitleError
Show an error page on a badtitle.
Definition
BadTitleError.php:34
BadTitleError\__construct
__construct( $msg='badtitletext', $params=[])
Definition
BadTitleError.php:42
BadTitleError\report
report( $action=self::SEND_OUTPUT)
to override
Definition
BadTitleError.php:59
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition
ErrorPageError.php:30
ErrorPageError\$msg
$msg
Definition
ErrorPageError.php:33
ErrorPageError\$params
$params
Definition
ErrorPageError.php:33
MalformedTitleException
MalformedTitleException is thrown when a TitleParser is unable to parse a title string.
Definition
MalformedTitleException.php:26
includes
exception
BadTitleError.php
Generated on Thu Jun 27 2024 14:02:42 for MediaWiki by
1.10.0