From: WMDE-Fisch Date: Wed, 26 Oct 2016 14:43:50 +0000 (+0200) Subject: Move condition to not show form one level up X-Git-Tag: 1.31.0-rc.0~4915^2 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=2993c377e60157fd88336fd5d60716192ddce8d8;p=lhc%2Fweb%2Fwiklou.git Move condition to not show form one level up This condition to abort the show form process was more or less hidden in the header method. The returned boolean was used nowhere else. Change-Id: I91335deac0547c24d107305a2ded503c9ab15090 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 4aa87d6c89..7d1cf1d66e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2620,10 +2620,21 @@ ERROR; $this->setHeaders(); - if ( $this->showHeader() === false ) { + $this->addTalkPageText(); + $this->addEditNotices(); + + if ( !$this->isConflict && + $this->section != '' && + !$this->isSectionEditSupported() ) { + // We use $this->section to much before this and getVal('wgSection') directly in other places + // at this point we can't reset $this->section to '' to fallback to non-section editing. + // Someone is welcome to try refactoring though + $wgOut->showErrorPage( 'sectioneditnotsupported-title', 'sectioneditnotsupported-text' ); return; } + $this->showHeader(); + $wgOut->addHTML( $this->editFormPageTop ); if ( $wgUser->getOption( 'previewontop' ) ) { @@ -2878,29 +2889,14 @@ ERROR; } } - /** - * @return bool - */ protected function showHeader() { global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang; global $wgAllowUserCss, $wgAllowUserJs; - $this->addTalkPageText(); - - $this->addEditNotices(); - if ( $this->isConflict ) { $wgOut->wrapWikiMsg( "
\n$1\n
", 'explainconflict' ); $this->editRevId = $this->page->getLatest(); } else { - if ( $this->section != '' && !$this->isSectionEditSupported() ) { - // We use $this->section to much before this and getVal('wgSection') directly in other places - // at this point we can't reset $this->section to '' to fallback to non-section editing. - // Someone is welcome to try refactoring though - $wgOut->showErrorPage( 'sectioneditnotsupported-title', 'sectioneditnotsupported-text' ); - return false; - } - if ( $this->section != '' && $this->section != 'new' ) { if ( !$this->summary && !$this->preview && !$this->diff ) { $sectionTitle = self::extractSectionTitle( $this->textbox1 ); // FIXME: use Content object @@ -3087,8 +3083,6 @@ ERROR; } # Add header copyright warning $this->showHeaderCopyrightWarning(); - - return true; } /**