Drop index oi_name_archive_name on table oldimage
[lhc/web/wiklou.git] / includes / EditPage.php
index f37ce34..05fa366 100644 (file)
@@ -295,7 +295,7 @@ class EditPage {
        /** @var bool Has a summary been preset using GET parameter &summary= ? */
        public $hasPresetSummary = false;
 
-       /** @var bool */
+       /** @var Revision|bool */
        public $mBaseRevision = false;
 
        /** @var bool */
@@ -661,7 +661,11 @@ class EditPage {
                $remove = [];
                foreach ( $permErrors as $error ) {
                        if ( ( $this->preview || $this->diff )
-                               && ( $error[0] == 'blockedtext' || $error[0] == 'autoblockedtext' )
+                               && (
+                                       $error[0] == 'blockedtext' ||
+                                       $error[0] == 'autoblockedtext' ||
+                                       $error[0] == 'systemblockedtext'
+                               )
                        ) {
                                $remove[] = $error;
                        }
@@ -2142,7 +2146,8 @@ class EditPage {
                        false,
                        $wgUser,
                        $content->getDefaultFormat(),
-                       $this->changeTags
+                       $this->changeTags,
+                       $this->undidRev
                );
 
                if ( !$doEditStatus->isOK() ) {
@@ -2597,7 +2602,9 @@ class EditPage {
                        $previewOutput = $this->getPreviewText();
                }
 
-               Hooks::run( 'EditPage::showEditForm:initial', [ &$this, &$wgOut ] );
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $editPage = $this;
+               Hooks::run( 'EditPage::showEditForm:initial', [ &$editPage, &$wgOut ] );
 
                $this->setHeaders();
 
@@ -2674,7 +2681,9 @@ class EditPage {
                        . Xml::closeElement( 'div' )
                );
 
-               Hooks::run( 'EditPage::showEditForm:fields', [ &$this, &$wgOut ] );
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $editPage = $this;
+               Hooks::run( 'EditPage::showEditForm:fields', [ &$editPage, &$wgOut ] );
 
                // Put these up at the top to ensure they aren't lost on early form submission
                $this->showFormBeforeText();
@@ -2834,7 +2843,7 @@ class EditPage {
         * @param Title[] $templates
         * @return string HTML
         */
-       protected function makeTemplatesOnThisPageList( array $templates ) {
+       public function makeTemplatesOnThisPageList( array $templates ) {
                $templateListFormatter = new TemplatesOnThisPageFormatter(
                        $this->context, MediaWikiServices::getInstance()->getLinkRenderer()
                );
@@ -3536,7 +3545,9 @@ HTML
        protected function showConflict() {
                global $wgOut;
 
-               if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, &$wgOut ] ) ) {
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $editPage = $this;
+               if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$editPage, &$wgOut ] ) ) {
                        $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                        $stats->increment( 'edit.failures.conflict' );
                        // Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics
@@ -4064,7 +4075,10 @@ HTML
                                $checkboxes['watch'] = $watchThisHtml;
                        }
                }
-               Hooks::run( 'EditPageBeforeEditChecks', [ &$this, &$checkboxes, &$tabindex ] );
+
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $editPage = $this;
+               Hooks::run( 'EditPageBeforeEditChecks', [ &$editPage, &$checkboxes, &$tabindex ] );
                return $checkboxes;
        }
 
@@ -4113,7 +4127,9 @@ HTML
                $buttons['diff'] = Html::submitButton( $this->context->msg( 'showdiff' )->text(),
                        $attribs );
 
-               Hooks::run( 'EditPageBeforeEditButtons', [ &$this, &$buttons, &$tabindex ] );
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $editPage = $this;
+               Hooks::run( 'EditPageBeforeEditButtons', [ &$editPage, &$buttons, &$tabindex ] );
                return $buttons;
        }
 
@@ -4127,7 +4143,10 @@ HTML
                $wgOut->prepareErrorPage( $this->context->msg( 'nosuchsectiontitle' ) );
 
                $res = $this->context->msg( 'nosuchsectiontext', $this->section )->parseAsBlock();
-               Hooks::run( 'EditPageNoSuchSection', [ &$this, &$res ] );
+
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $editPage = $this;
+               Hooks::run( 'EditPageNoSuchSection', [ &$editPage, &$res ] );
                $wgOut->addHTML( $res );
 
                $wgOut->returnToMain( false, $this->mTitle );
@@ -4422,8 +4441,8 @@ HTML
                $attribs = $customAttribs + [
                                'accesskey' => ',',
                                'id' => $name,
-                               'cols' => $user->getIntOption( 'cols' ),
-                               'rows' => $user->getIntOption( 'rows' ),
+                               'cols' => 80,
+                               'rows' => 25,
                                // Avoid PHP notices when appending preferences
                                // (appending allows customAttribs['style'] to still work).
                                'style' => ''