}
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" .
// Check for disabled actions
if ( in_array( $action, $wgDisabledActions ) ) {
- $action = 'nosuchaction';
- } elseif ( $action === 'historysubmit' ) {
- // Workaround for bug #20966: inability of IE to provide an action dependent
- // on which submit button is clicked.
+ return 'nosuchaction';
+ }
+
+ // Workaround for bug #20966: inability of IE to provide an action dependent
+ // on which submit button is clicked.
+ if ( $action === 'historysubmit' ) {
if ( $request->getBool( 'revisiondelete' ) ) {
- $action = 'revisiondelete';
+ return 'revisiondelete';
} else {
- $action = 'view';
+ return 'view';
}
} elseif ( $action == 'editredlink' ) {
- $action = 'edit';
+ return 'edit';
}
- // Write back the executed action
- $request->setVal( 'action', $action );
return $action;
}
// Output everything!
$this->context->getOutput()->output();
// Do any deferred jobs
- wfDoUpdates( 'commit' );
+ DeferredUpdates::doUpdates( 'commit' );
$this->doJobs();
wfProfileOut( __METHOD__ );
}
break;
default:
if ( wfRunHooks( 'UnknownAction', array( $act, $article ) ) ) {
- $request->setVal( 'action', 'nosuchaction' );
$output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
}