', true, /* interface */true );
}
if ( $content === false ) {
- $content = $this->getOriginalContent( $wgUser );
+ $content = $this->getOriginalContent( $user );
}
}
}
@@ -1368,10 +1385,10 @@ class EditPage {
* @private
*/
function tokenOk( &$request ) {
- global $wgUser;
$token = $request->getVal( 'wpEditToken' );
- $this->mTokenOk = $wgUser->matchEditToken( $token );
- $this->mTokenOkExceptSuffix = $wgUser->matchEditTokenNoSuffix( $token );
+ $user = $this->context->getUser();
+ $this->mTokenOk = $user->matchEditToken( $token );
+ $this->mTokenOkExceptSuffix = $user->matchEditTokenNoSuffix( $token );
return $this->mTokenOk;
}
@@ -1402,7 +1419,7 @@ class EditPage {
$val = 'restored';
}
- $response = RequestContext::getMain()->getRequest()->response();
+ $response = $this->context->getRequest()->response();
$response->setCookie( $postEditKey, $val, time() + self::POST_EDIT_COOKIE_DURATION, [
'httpOnly' => false,
] );
@@ -1410,15 +1427,13 @@ class EditPage {
/**
* Attempt submission
- * @param array $resultDetails See docs for $result in internalAttemptSave
+ * @param array|bool $resultDetails See docs for $result in internalAttemptSave
* @throws UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
* @return Status The resulting status object.
*/
public function attemptSave( &$resultDetails = false ) {
- global $wgUser;
-
# Allow bots to exempt some edits from bot flagging
- $bot = $wgUser->isAllowed( 'bot' ) && $this->bot;
+ $bot = $this->context->getUser()->isAllowed( 'bot' ) && $this->bot;
$status = $this->internalAttemptSave( $resultDetails, $bot );
Hooks::run( 'EditPage::attemptSave:after', [ $this, $status, $resultDetails ] );
@@ -1436,8 +1451,6 @@ class EditPage {
* @return bool False, if output is done, true if rest of the form should be displayed
*/
private function handleStatus( Status $status, $resultDetails ) {
- global $wgUser, $wgOut;
-
/**
* @todo FIXME: once the interface for internalAttemptSave() is made
* nicer, this should use the message in $status
@@ -1451,9 +1464,11 @@ class EditPage {
}
}
+ $out = $this->context->getOutput();
+
// "wpExtraQueryRedirect" is a hidden input to modify
// after save URL and is not used by actual edit form
- $request = RequestContext::getMain()->getRequest();
+ $request = $this->context->getRequest();
$extraQueryRedirect = $request->getVal( 'wpExtraQueryRedirect' );
switch ( $status->value ) {
@@ -1474,7 +1489,7 @@ class EditPage {
case self::AS_CANNOT_USE_CUSTOM_MODEL:
case self::AS_PARSE_ERROR:
- $wgOut->addWikiText( '
' . "\n" . $status->getWikiText() . '
' );
+ $out->addWikiText( '
' . "\n" . $status->getWikiText() . '
' );
return true;
case self::AS_SUCCESS_NEW_ARTICLE:
@@ -1487,7 +1502,7 @@ class EditPage {
}
}
$anchor = isset( $resultDetails['sectionanchor'] ) ? $resultDetails['sectionanchor'] : '';
- $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $anchor );
+ $out->redirect( $this->mTitle->getFullURL( $query ) . $anchor );
return false;
case self::AS_SUCCESS_UPDATE:
@@ -1515,7 +1530,7 @@ class EditPage {
}
}
- $wgOut->redirect( $this->mTitle->getFullURL( $extraQuery ) . $sectionanchor );
+ $out->redirect( $this->mTitle->getFullURL( $extraQuery ) . $sectionanchor );
return false;
case self::AS_SPAM_ERROR:
@@ -1523,7 +1538,7 @@ class EditPage {
return false;
case self::AS_BLOCKED_PAGE_FOR_USER:
- throw new UserBlockedError( $wgUser->getBlock() );
+ throw new UserBlockedError( $this->context->getUser()->getBlock() );
case self::AS_IMAGE_REDIRECT_ANON:
case self::AS_IMAGE_REDIRECT_LOGGED:
@@ -1584,7 +1599,7 @@ class EditPage {
// Run new style post-section-merge edit filter
if ( !Hooks::run( 'EditFilterMergedContent',
- [ $this->mArticle->getContext(), $content, $status, $this->summary,
+ [ $this->context, $content, $status, $this->summary,
$user, $this->minoredit ] )
) {
# Error messages etc. could be handled within the hook...
@@ -1669,10 +1684,11 @@ class EditPage {
* time.
*/
function internalAttemptSave( &$result, $bot = false ) {
- global $wgUser, $wgRequest, $wgParser, $wgMaxArticleSize;
- global $wgContentHandlerUseDB;
+ global $wgParser, $wgMaxArticleSize, $wgContentHandlerUseDB;
$status = Status::newGood();
+ $user = $this->context->getUser();
+ $request = $this->context->getRequest();
if ( !Hooks::run( 'EditPage::attemptSave', [ $this ] ) ) {
wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
@@ -1681,11 +1697,11 @@ class EditPage {
return $status;
}
- $spam = $wgRequest->getText( 'wpAntispam' );
+ $spam = $request->getText( 'wpAntispam' );
if ( $spam !== '' ) {
wfDebugLog(
'SimpleAntiSpam',
- $wgUser->getName() .
+ $user->getName() .
' editing "' .
$this->mTitle->getPrefixedText() .
'" submitted bogus field "' .
@@ -1714,9 +1730,9 @@ class EditPage {
# Check image redirect
if ( $this->mTitle->getNamespace() == NS_FILE &&
$textbox_content->isRedirect() &&
- !$wgUser->isAllowed( 'upload' )
+ !$user->isAllowed( 'upload' )
) {
- $code = $wgUser->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
+ $code = $user->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
$status->setResult( false, $code );
return $status;
@@ -1741,7 +1757,7 @@ class EditPage {
}
if ( $match !== false ) {
$result['spam'] = $match;
- $ip = $wgRequest->getIP();
+ $ip = $request->getIP();
$pdbk = $this->mTitle->getPrefixedDBkey();
$match = str_replace( "\n", '', $match );
wfDebugLog( 'SpamRegex', "$ip spam regex hit [[$pdbk]]: \"$match\"" );
@@ -1764,10 +1780,10 @@ class EditPage {
return $status;
}
- if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
+ if ( $user->isBlockedFrom( $this->mTitle, false ) ) {
// Auto-block user's IP if the account was "hard" blocked
if ( !wfReadOnly() ) {
- $wgUser->spreadAnyEditBlock();
+ $user->spreadAnyEditBlock();
}
# Check block state against master, thus 'false'.
$status->setResult( false, self::AS_BLOCKED_PAGE_FOR_USER );
@@ -1782,8 +1798,8 @@ class EditPage {
return $status;
}
- if ( !$wgUser->isAllowed( 'edit' ) ) {
- if ( $wgUser->isAnon() ) {
+ if ( !$user->isAllowed( 'edit' ) ) {
+ if ( $user->isAnon() ) {
$status->setResult( false, self::AS_READ_ONLY_PAGE_ANON );
return $status;
} else {
@@ -1799,7 +1815,7 @@ class EditPage {
$status->fatal( 'editpage-cannot-use-custom-model' );
$status->value = self::AS_CANNOT_USE_CUSTOM_MODEL;
return $status;
- } elseif ( !$wgUser->isAllowed( 'editcontentmodel' ) ) {
+ } elseif ( !$user->isAllowed( 'editcontentmodel' ) ) {
$status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL );
return $status;
@@ -1810,7 +1826,7 @@ class EditPage {
if ( $this->changeTags ) {
$changeTagsStatus = ChangeTags::canAddTagsAccompanyingChange(
- $this->changeTags, $wgUser );
+ $this->changeTags, $user );
if ( !$changeTagsStatus->isOK() ) {
$changeTagsStatus->value = self::AS_CHANGE_TAG_ERROR;
return $changeTagsStatus;
@@ -1822,7 +1838,7 @@ class EditPage {
$status->value = self::AS_READ_ONLY_PAGE;
return $status;
}
- if ( $wgUser->pingLimiter() || $wgUser->pingLimiter( 'linkpurge', 0 ) ) {
+ if ( $user->pingLimiter() || $user->pingLimiter( 'linkpurge', 0 ) ) {
$status->fatal( 'actionthrottledtext' );
$status->value = self::AS_RATE_LIMITED;
return $status;
@@ -1842,7 +1858,7 @@ class EditPage {
if ( $new ) {
// Late check for create permission, just in case *PARANOIA*
- if ( !$this->mTitle->userCan( 'create', $wgUser ) ) {
+ if ( !$this->mTitle->userCan( 'create', $user ) ) {
$status->fatal( 'nocreatetext' );
$status->value = self::AS_NO_CREATE_PERMISSION;
wfDebug( __METHOD__ . ": no create permission\n" );
@@ -1866,7 +1882,7 @@ class EditPage {
return $status;
}
- if ( !$this->runPostMergeFilters( $textbox_content, $status, $wgUser ) ) {
+ if ( !$this->runPostMergeFilters( $textbox_content, $status, $user ) ) {
return $status;
}
@@ -1902,7 +1918,7 @@ class EditPage {
) {
$this->isConflict = true;
if ( $this->section == 'new' ) {
- if ( $this->page->getUserText() == $wgUser->getName() &&
+ if ( $this->page->getUserText() == $user->getName() &&
$this->page->getComment() == $this->newSectionSummary()
) {
// Probably a duplicate submission of a new comment.
@@ -1918,7 +1934,7 @@ class EditPage {
} elseif ( $this->section == ''
&& Revision::userWasLastToEdit(
DB_MASTER, $this->mTitle->getArticleID(),
- $wgUser->getId(), $this->edittime
+ $user->getId(), $this->edittime
)
) {
# Suppress edit conflict with self, except for section edits where merging is required.
@@ -1988,7 +2004,7 @@ class EditPage {
return $status;
}
- if ( !$this->runPostMergeFilters( $content, $status, $wgUser ) ) {
+ if ( !$this->runPostMergeFilters( $content, $status, $user ) ) {
return $status;
}
@@ -2009,7 +2025,7 @@ class EditPage {
return $status;
}
} elseif ( !$this->allowBlankSummary
- && !$content->equals( $this->getOriginalContent( $wgUser ) )
+ && !$content->equals( $this->getOriginalContent( $user ) )
&& !$content->isRedirect()
&& md5( $this->summary ) == $this->autoSumm
) {
@@ -2079,7 +2095,7 @@ class EditPage {
$this->summary,
$flags,
false,
- $wgUser,
+ $user,
$content->getDefaultFormat(),
$this->changeTags
);
@@ -2102,7 +2118,7 @@ class EditPage {
$result['nullEdit'] = $doEditStatus->hasMessage( 'edit-no-change' );
if ( $result['nullEdit'] ) {
// We don't know if it was a null edit until now, so increment here
- $wgUser->pingLimiter( 'linkpurge' );
+ $user->pingLimiter( 'linkpurge' );
}
$result['redirect'] = $content->isRedirect();
@@ -2111,7 +2127,7 @@ class EditPage {
// If the content model changed, add a log entry
if ( $changingContentModel ) {
$this->addContentModelChangeLogEntry(
- $wgUser,
+ $user,
$new ? false : $oldContentModel,
$this->contentModel,
$this->summary
@@ -2145,13 +2161,12 @@ class EditPage {
* Register the change of watch status
*/
protected function updateWatchlist() {
- global $wgUser;
+ $user = $this->context->getUser();
- if ( !$wgUser->isLoggedIn() ) {
+ if ( !$user->isLoggedIn() ) {
return;
}
- $user = $wgUser;
$title = $this->mTitle;
$watch = $this->watchthis;
// Do this in its own transaction to reduce contention...
@@ -2266,29 +2281,32 @@ class EditPage {
}
function setHeaders() {
- global $wgOut, $wgUser, $wgAjaxEditStash;
+ global $wgAjaxEditStash;
+
+ $out = $this->context->getOutput();
+ $user = $this->context->getUser();
- $wgOut->addModules( 'mediawiki.action.edit' );
- $wgOut->addModuleStyles( 'mediawiki.action.edit.styles' );
+ $out->addModules( 'mediawiki.action.edit' );
+ $out->addModuleStyles( 'mediawiki.action.edit.styles' );
- if ( $wgUser->getOption( 'showtoolbar' ) ) {
+ if ( $user->getOption( 'showtoolbar' ) ) {
// The addition of default buttons is handled by getEditToolbar() which
// has its own dependency on this module. The call here ensures the module
// is loaded in time (it has position "top") for other modules to register
// buttons (e.g. extensions, gadgets, user scripts).
- $wgOut->addModules( 'mediawiki.toolbar' );
+ $out->addModules( 'mediawiki.toolbar' );
}
- if ( $wgUser->getOption( 'uselivepreview' ) ) {
- $wgOut->addModules( 'mediawiki.action.edit.preview' );
+ if ( $user->getOption( 'uselivepreview' ) ) {
+ $out->addModules( 'mediawiki.action.edit.preview' );
}
- if ( $wgUser->getOption( 'useeditwarning' ) ) {
- $wgOut->addModules( 'mediawiki.action.edit.editWarning' );
+ if ( $user->getOption( 'useeditwarning' ) ) {
+ $out->addModules( 'mediawiki.action.edit.editWarning' );
}
# Enabled article-related sidebar, toplinks, etc.
- $wgOut->setArticleRelated( true );
+ $out->setArticleRelated( true );
$contextTitle = $this->getContextTitle();
if ( $this->isConflict ) {
@@ -2311,10 +2329,10 @@ class EditPage {
if ( $displayTitle === false ) {
$displayTitle = $contextTitle->getPrefixedText();
}
- $wgOut->setPageTitle( wfMessage( $msg, $displayTitle ) );
+ $out->setPageTitle( wfMessage( $msg, $displayTitle ) );
# Transmit the name of the message to JavaScript for live preview
# Keep Resources.php/mediawiki.action.edit.preview in sync with the possible keys
- $wgOut->addJsConfigVars( [
+ $out->addJsConfigVars( [
'wgEditMessage' => $msg,
'wgAjaxEditStash' => $wgAjaxEditStash,
] );
@@ -2324,16 +2342,16 @@ class EditPage {
* Show all applicable editing introductions
*/
protected function showIntro() {
- global $wgOut, $wgUser;
if ( $this->suppressIntro ) {
return;
}
+ $out = $this->context->getOutput();
$namespace = $this->mTitle->getNamespace();
if ( $namespace == NS_MEDIAWIKI ) {
# Show a warning if editing an interface message
- $wgOut->wrapWikiMsg( "
\n$1\n
", 'editinginterface' );
+ $out->wrapWikiMsg( "
\n$1\n
", 'editinginterface' );
# If this is a default message (but not css or js),
# show a hint that it is translatable on translatewiki.net
if ( !$this->mTitle->hasContentModel( CONTENT_MODEL_CSS )
@@ -2341,7 +2359,7 @@ class EditPage {
) {
$defaultMessageText = $this->mTitle->getDefaultMessageText();
if ( $defaultMessageText !== false ) {
- $wgOut->wrapWikiMsg( "
\n$1\n
",
+ $out->wrapWikiMsg( "
\n$1\n
",
'translateinterface' );
}
}
@@ -2353,11 +2371,11 @@ class EditPage {
# there must be a description url to show a hint to shared repo
if ( $descUrl ) {
if ( !$this->mTitle->exists() ) {
- $wgOut->wrapWikiMsg( "
", [
'sharedupload-desc-edit', $file->getRepo()->getDisplayName(), $descUrl
] );
}
@@ -2373,12 +2391,12 @@ class EditPage {
$ip = User::isIP( $username );
$block = Block::newFromTarget( $user, $user );
if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
- $wgOut->wrapWikiMsg( "
\n$1\n
",
+ $out->wrapWikiMsg( "
\n$1\n
",
[ 'userpage-userdoesnotexist', wfEscapeWikiText( $username ) ] );
} elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
# Show log extract if the user is currently blocked
LogEventsList::showLogExtract(
- $wgOut,
+ $out,
'block',
MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget(),
'',
@@ -2398,8 +2416,8 @@ class EditPage {
$helpLink = wfExpandUrl( Skin::makeInternalOrExternalUrl(
wfMessage( 'helppage' )->inContentLanguage()->text()
) );
- if ( $wgUser->isLoggedIn() ) {
- $wgOut->wrapWikiMsg(
+ if ( $this->context->getUser()->isLoggedIn() ) {
+ $out->wrapWikiMsg(
// Suppress the external link icon, consider the help url an internal one
"
\n$1\n
",
[
@@ -2408,7 +2426,7 @@ class EditPage {
]
);
} else {
- $wgOut->wrapWikiMsg(
+ $out->wrapWikiMsg(
// Suppress the external link icon, consider the help url an internal one
"
\n$1\n
",
[
@@ -2420,7 +2438,7 @@ class EditPage {
}
# Give a notice if the user is editing a deleted/moved page...
if ( !$this->mTitle->exists() ) {
- LogEventsList::showLogExtract( $wgOut, [ 'delete', 'move' ], $this->mTitle,
+ LogEventsList::showLogExtract( $out, [ 'delete', 'move' ], $this->mTitle,
'',
[
'lim' => 10,
@@ -2441,9 +2459,8 @@ class EditPage {
if ( $this->editintro ) {
$title = Title::newFromText( $this->editintro );
if ( $title instanceof Title && $title->exists() && $title->userCan( 'read' ) ) {
- global $wgOut;
// Added using template syntax, to take 's into account.
- $wgOut->addWikiTextTitleTidy(
+ $this->context->getOutput()->addWikiTextTitleTidy(
'
{{:' . $title->getFullText() . '}}
',
$this->mTitle
);
@@ -2493,7 +2510,7 @@ class EditPage {
* content.
*
* @param string|null|bool $text Text to unserialize
- * @return Content The content object created from $text. If $text was false
+ * @return Content|bool|null The content object created from $text. If $text was false
* or null, false resp. null will be returned instead.
*
* @throws MWException If unserializing the text results in a Content
@@ -2525,8 +2542,6 @@ class EditPage {
* use the EditPage::showEditForm:fields hook instead.
*/
function showEditForm( $formCallback = null ) {
- global $wgOut, $wgUser;
-
# need to parse the preview early so that we know which templates are used,
# otherwise users with "show preview after edit box" will get a blank list
# we parse this near the beginning so that setHeaders can do the title
@@ -2536,7 +2551,8 @@ class EditPage {
$previewOutput = $this->getPreviewText();
}
- Hooks::run( 'EditPage::showEditForm:initial', [ &$this, &$wgOut ] );
+ $out = $this->context->getOutput();
+ Hooks::run( 'EditPage::showEditForm:initial', [ &$this, &$out ] );
$this->setHeaders();
@@ -2544,13 +2560,14 @@ class EditPage {
return;
}
- $wgOut->addHTML( $this->editFormPageTop );
+ $out->addHTML( $this->editFormPageTop );
- if ( $wgUser->getOption( 'previewontop' ) ) {
+ $user = $this->context->getUser();
+ if ( $user->getOption( 'previewontop' ) ) {
$this->displayPreviewArea( $previewOutput, true );
}
- $wgOut->addHTML( $this->editFormTextTop );
+ $out->addHTML( $this->editFormTextTop );
$showToolbar = true;
if ( $this->wasDeletedSinceLastEdit() ) {
@@ -2559,14 +2576,14 @@ class EditPage {
// Add an confirmation checkbox and explanation.
$showToolbar = false;
} else {
- $wgOut->wrapWikiMsg( "
\n$1\n
",
+ $out->wrapWikiMsg( "
\n$1\n
",
'deletedwhileediting' );
}
}
// @todo add EditForm plugin interface and use it here!
// search for textarea1 and textares2, and allow EditForm to override all uses.
- $wgOut->addHTML( Html::openElement(
+ $out->addHTML( Html::openElement(
'form',
[
'id' => self::EDITFORM_ID,
@@ -2579,11 +2596,11 @@ class EditPage {
if ( is_callable( $formCallback ) ) {
wfWarn( 'The $formCallback parameter to ' . __METHOD__ . 'is deprecated' );
- call_user_func_array( $formCallback, [ &$wgOut ] );
+ call_user_func_array( $formCallback, [ &$out ] );
}
// Add an empty field to trip up spambots
- $wgOut->addHTML(
+ $out->addHTML(
Xml::openElement( 'div', [ 'id' => 'antispam-container', 'style' => 'display: none;' ] )
. Html::rawElement(
'label',
@@ -2602,7 +2619,7 @@ class EditPage {
. Xml::closeElement( 'div' )
);
- Hooks::run( 'EditPage::showEditForm:fields', [ &$this, &$wgOut ] );
+ Hooks::run( 'EditPage::showEditForm:fields', [ &$this, &$out ] );
// Put these up at the top to ensure they aren't lost on early form submission
$this->showFormBeforeText();
@@ -2616,7 +2633,7 @@ class EditPage {
$key = $comment === ''
? 'confirmrecreate-noreason'
: 'confirmrecreate';
- $wgOut->addHTML(
+ $out->addHTML(
'
' );
}
}
@@ -2745,14 +2762,14 @@ class EditPage {
} else {
$mode = 'text';
}
- $wgOut->addHTML( Html::hidden( 'mode', $mode, [ 'id' => 'mw-edit-mode' ] ) );
+ $out->addHTML( Html::hidden( 'mode', $mode, [ 'id' => 'mw-edit-mode' ] ) );
// Marker for detecting truncated form data. This must be the last
// parameter sent in order to be of use, so do not move me.
- $wgOut->addHTML( Html::hidden( 'wpUltimateParam', true ) );
- $wgOut->addHTML( $this->editFormTextBottom . "\n\n" );
+ $out->addHTML( Html::hidden( 'wpUltimateParam', true ) );
+ $out->addHTML( $this->editFormTextBottom . "\n\n" );
- if ( !$wgUser->getOption( 'previewontop' ) ) {
+ if ( !$user->getOption( 'previewontop' ) ) {
$this->displayPreviewArea( $previewOutput, false );
}
@@ -2778,21 +2795,23 @@ class EditPage {
* @return bool
*/
protected function showHeader() {
- global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang;
- global $wgAllowUserCss, $wgAllowUserJs;
+ global $wgMaxArticleSize, $wgAllowUserCss, $wgAllowUserJs;
+
+ $out = $this->context->getOutput();
+ $user = $this->context->getUser();
if ( $this->mTitle->isTalkPage() ) {
- $wgOut->addWikiMsg( 'talkpagetext' );
+ $out->addWikiMsg( 'talkpagetext' );
}
// Add edit notices
$editNotices = $this->mTitle->getEditNotices( $this->oldid );
if ( count( $editNotices ) ) {
- $wgOut->addHTML( implode( "\n", $editNotices ) );
+ $out->addHTML( implode( "\n", $editNotices ) );
} else {
$msg = wfMessage( 'editnotice-notext' );
if ( !$msg->isDisabled() ) {
- $wgOut->addHTML(
+ $out->addHTML(
'
'
. $msg->parseAsBlock()
. '
'
@@ -2801,14 +2820,14 @@ class EditPage {
}
if ( $this->isConflict ) {
- $wgOut->wrapWikiMsg( "
\n$1\n
", 'explainconflict' );
+ $out->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' );
+ $out->showErrorPage( 'sectioneditnotsupported-title', 'sectioneditnotsupported-text' );
return false;
}
@@ -2822,31 +2841,31 @@ class EditPage {
}
if ( $this->missingComment ) {
- $wgOut->wrapWikiMsg( "
\n" );
}
/**
@@ -3503,10 +3525,9 @@ HTML
* If you want to use another entry point to this function, be careful.
*/
protected function showConflict() {
- global $wgOut;
-
- if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, &$wgOut ] ) ) {
- $stats = $wgOut->getContext()->getStats();
+ $out = $this->context->getOutput();
+ if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, &$out ] ) ) {
+ $stats = $this->context->getStats();
$stats->increment( 'edit.failures.conflict' );
// Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics
if (
@@ -3516,7 +3537,7 @@ HTML
$stats->increment( 'edit.failures.conflict.byNamespaceId.' . $this->mTitle->getNamespace() );
}
- $wgOut->wrapWikiMsg( '
', "yourtext" );
$this->showTextbox2();
}
}
@@ -3642,10 +3663,10 @@ HTML
* @return string
*/
function getPreviewText() {
- global $wgOut, $wgRawHtml, $wgLang;
- global $wgAllowUserCss, $wgAllowUserJs;
+ global $wgRawHtml, $wgAllowUserCss, $wgAllowUserJs;
- $stats = $wgOut->getContext()->getStats();
+ $stats = $this->context->getStats();
+ $out = $this->context->getOutput();
if ( $wgRawHtml && !$this->mTokenOk ) {
// Could be an offsite preview attempt. This is very unsafe if
@@ -3655,7 +3676,7 @@ HTML
// Do not put big scary notice, if previewing the empty
// string, which happens when you initially edit
// a category page, due to automatic preview-on-open.
- $parsedNote = $wgOut->parse( "