* (bug 27775) Namespace has it's own XML tag in the XML dump file.
* (bug 30513) Redirect tag is now resolved in XML dump file.
* sha1 xml tag added to XML dump file.
+* (bug 33646) Badtitle error page now emits a 400 HTTP status.
=== Bug fixes in 1.19 ===
* $wgUploadNavigationUrl should be used for file redlinks if.
function report() {
global $wgOut;
+
$wgOut->showErrorPage( $this->title, $this->msg, $this->params );
$wgOut->output();
}
}
+/**
+ * Show an error page on a badtitle.
+ * Similar to ErrorPage, but emit a 400 HTTP error code to let mobile
+ * browser it is not really a valid content.
+ */
+class BadTitleError extends ErrorPageError {
+
+ /**
+ * @param $msg string A message key (default: 'badtitletext')
+ * @param $params Array parameter to wfMsg()
+ */
+ function __construct( $msg = 'badtitletext', $params = null ) {
+ parent::__construct( 'badtitle', $msg, $params );
+ }
+
+ /**
+ * Just like ErrorPageError::report() but additionally set
+ * a 400 HTTP status code (bug 33646).
+ */
+ function report() {
+ global $wgOut;
+
+ // bug 33646: a badtitle error page need to return an error code
+ // to let mobile browser now that it is not a normal page.
+ $wgOut->setStatusCode( 400 );
+ parent::report();
+ }
+
+}
+
/**
* Show an error when a user tries to do something they do not have the necessary
* permissions for.
{
$this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
wfProfileOut( __METHOD__ );
- throw new ErrorPageError( 'badtitle', 'badtitletext' );
+ throw new BadTitleError();
}
// Check user's permissions to read this page.
} else {
$this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
wfProfileOut( __METHOD__ );
- throw new ErrorPageError( 'badtitle', 'badtitletext' );
+ throw new BadTitleError();
}
// Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
} elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()