}
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' ) ) {
*
* @param Title $title
* @param string $format Output format, valid values are any function of a Message object
+ * @param Language|string|null $langcode Language code or Language object.
* @return string
*/
public static function getCopyrightWarning( $title, $format = 'plain', $langcode = null ) {
global $wgOut;
if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, &$wgOut ] ) ) {
- $stats = $wgOut->getContext()->getStats();
+ $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
$stats->increment( 'edit.failures.conflict' );
// Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics
if (
global $wgOut, $wgRawHtml, $wgLang;
global $wgAllowUserCss, $wgAllowUserJs;
- $stats = $wgOut->getContext()->getStats();
+ $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
if ( $wgRawHtml && !$this->mTokenOk ) {
// Could be an offsite preview attempt. This is very unsafe if
/**
* 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',
}
/**
- * @param OutputPage &$out
+ * @param OutputPage $out
* @since 1.29
*/
- protected function addExplainConflictHeader( OutputPage &$out ) {
+ protected function addExplainConflictHeader( OutputPage $out ) {
$out->wrapWikiMsg( "<div class='mw-explainconflict'>\n$1\n</div>", 'explainconflict' );
}
/**
* @param string $name
* @param mixed[] $customAttribs
- * @param User $wgUser
+ * @param User $user
* @return mixed[]
* @since 1.29
*/
- protected function buildTextboxAttribs( $name, array $customAttribs, User $wgUser ) {
+ protected function buildTextboxAttribs( $name, array $customAttribs, User $user ) {
$attribs = $customAttribs + [
'accesskey' => ',',
'id' => $name,
- 'cols' => $wgUser->getIntOption( 'cols' ),
- 'rows' => $wgUser->getIntOption( 'rows' ),
+ 'cols' => $user->getIntOption( 'cols' ),
+ 'rows' => $user->getIntOption( 'rows' ),
// Avoid PHP notices when appending preferences
// (appending allows customAttribs['style'] to still work).
'style' => ''
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif
- $class = 'mw-editfont-' . $wgUser->getOption( 'editfont' );
+ $class = 'mw-editfont-' . $user->getOption( 'editfont' );
if ( isset( $attribs['class'] ) ) {
if ( is_string( $attribs['class'] ) ) {