public function __construct() {
parent::__construct( 'NewSection' );
$this->mAllowedRedirectParams = [ 'preloadtitle', 'nosummary', 'editintro',
- 'preload', 'preloadparams[]', 'summary' ];
+ 'preload', 'preloadparams', 'summary' ];
}
/**
protected function showNoRedirectPage() {
$this->setHeaders();
$this->outputHeader();
+ $this->addHelpLink( 'Help:New section' );
$this->showForm();
}
public function onFormSubmit( $formData ) {
$title = $formData['page'];
- $page = Title::newFromText( $title );
+ try {
+ $page = Title::newFromTextThrow( $title );
+ } catch ( MalformedTitleException $e ) {
+ return Status::newFatal( $e->getMessageObject() );
+ }
$query = [ 'action' => 'edit', 'section' => 'new' ];
$url = $page->getFullUrlForRedirect( $query );
$this->getOutput()->redirect( $url );