/** @var bool Has a summary been preset using GET parameter &summary= ? */
public $hasPresetSummary = false;
- /** @var bool */
+ /** @var Revision|bool */
public $mBaseRevision = false;
/** @var bool */
$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;
}
false,
$wgUser,
$content->getDefaultFormat(),
- $this->changeTags
+ $this->changeTags,
+ $this->undidRev
);
if ( !$doEditStatus->isOK() ) {
}
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' ) ) {
$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();
. 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();
}
if ( $newContent ) {
- ContentHandler::runLegacyHooks( 'EditPageGetDiffText', [ $this, &$newContent ], '1.21' );
Hooks::run( 'EditPageGetDiffContent', [ $this, &$newContent ] );
$popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
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
$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;
}
/**
* Returns an array of html code of the following buttons:
- * save, diff, preview and live
+ * save, diff and preview
*
* @param int $tabindex Current tabindex
*
] + Linker::tooltipAndAccesskeyAttribs( 'preview' );
$buttons['preview'] = Html::submitButton( $this->context->msg( 'showpreview' )->text(),
$attribs );
- $buttons['live'] = '';
$attribs = [
'id' => 'wpDiff',
$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;
}
$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 );