Merge "Remove FileRepoStatus references"
[lhc/web/wiklou.git] / includes / EditPage.php
index 82ddee0..1f871e1 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() ) {
@@ -2326,9 +2331,12 @@ class EditPage {
        }
 
        function setHeaders() {
-               global $wgOut, $wgUser, $wgAjaxEditStash;
+               global $wgOut, $wgUser, $wgAjaxEditStash, $wgCookieSetOnAutoblock;
 
                $wgOut->addModules( 'mediawiki.action.edit' );
+               if ( $wgCookieSetOnAutoblock === true ) {
+                       $wgOut->addModules( 'mediawiki.user.blockcookie' );
+               }
                $wgOut->addModuleStyles( 'mediawiki.action.edit.styles' );
 
                if ( $wgUser->getOption( 'showtoolbar' ) ) {
@@ -3323,7 +3331,6 @@ HTML
                }
 
                if ( $newContent ) {
-                       ContentHandler::runLegacyHooks( 'EditPageGetDiffText', [ $this, &$newContent ], '1.21' );
                        Hooks::run( 'EditPageGetDiffContent', [ $this, &$newContent ] );
 
                        $popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
@@ -4068,7 +4075,7 @@ HTML
 
        /**
         * Returns an array of html code of the following buttons:
-        * save, diff, preview and live
+        * save, diff and preview
         *
         * @param int $tabindex Current tabindex
         *
@@ -4102,7 +4109,6 @@ HTML
                ] + Linker::tooltipAndAccesskeyAttribs( 'preview' );
                $buttons['preview'] = Html::submitButton( $this->context->msg( 'showpreview' )->text(),
                        $attribs );
-               $buttons['live'] = '';
 
                $attribs = [
                        'id' => 'wpDiff',