}
if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) {
- $ret = new BadTitle;
+ $ret = SpecialPage::getTitleFor( 'Badtitle' );
}
return $ret;
array( &$title, null, &$output, &$user, $request, $this ) );
// Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
- if ( $title instanceof BadTitle ) {
+ if ( is_null( $title ) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) {
+ $this->context->title = SpecialPage::getTitleFor( 'Badtitle' );
throw new ErrorPageError( 'badtitle', 'badtitletext' );
// If the user is not logged in, the Namespace:title of the article must be in
// the Read array in order for the user to see it. (We have to check here to
// 301 so google et al report the target as the actual url.
$output->redirect( $url, 301 );
} else {
- $this->context->setTitle( new BadTitle );
+ $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
wfProfileOut( __METHOD__ );
throw new ErrorPageError( 'badtitle', 'badtitletext' );
}
$title = SpecialPage::getTitleFor( $name, $subpage );
}
}
- $targetUrl = $title->getFullURL();
+ $targetUrl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
// Redirect to canonical url, make it a 301 to allow caching
if ( $targetUrl == $request->getFullRequestURL() ) {
$message = "Redirect loop detected!\n\n" .
// Output everything!
$this->context->getOutput()->output();
// Do any deferred jobs
- wfDoUpdates( 'commit' );
+ DeferredUpdates::doUpdates( 'commit' );
$this->doJobs();
wfProfileOut( __METHOD__ );
}