Merge "Add german alias for special page NewSection"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 12 Aug 2019 09:57:42 +0000 (09:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 12 Aug 2019 09:57:42 +0000 (09:57 +0000)
includes/specials/SpecialNewSection.php

index a24d8cd..c124c14 100644 (file)
@@ -62,7 +62,11 @@ class SpecialNewSection extends RedirectSpecialPage {
 
        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 );