MediaWiki master
DefaultPreferencesFactory.php
Go to the documentation of this file.
1<?php
6
8
53use OOUI\ButtonWidget;
54use OOUI\FieldLayout;
55use OOUI\HorizontalLayout;
56use OOUI\HtmlSnippet;
57use OOUI\LabelWidget;
58use OOUI\MessageWidget;
59use Psr\Log\LoggerAwareTrait;
60use Psr\Log\NullLogger;
61use UnexpectedValueException;
63
68 use LoggerAwareTrait;
69
71 protected $options;
72
74 protected $contLang;
75
78
80 protected $authManager;
81
83 protected $linkRenderer;
84
86 protected $nsInfo;
87
90
92 private $languageConverter;
93
95 private $hookRunner;
96
99
101 private $languageConverterFactory;
102
104 private $parserFactory;
105
107 private $skinFactory;
108
110 private $userGroupManager;
111
113 private $signatureValidatorFactory;
114
118 public const CONSTRUCTOR_OPTIONS = [
150 ];
151
169 public function __construct(
176 ILanguageConverter $languageConverter,
178 HookContainer $hookContainer,
179 UserOptionsLookup $userOptionsLookup,
180 ?LanguageConverterFactory $languageConverterFactory = null,
181 ?ParserFactory $parserFactory = null,
182 ?SkinFactory $skinFactory = null,
183 ?UserGroupManager $userGroupManager = null,
184 ?SignatureValidatorFactory $signatureValidatorFactory = null
185 ) {
186 $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
187
188 $this->options = $options;
189 $this->contLang = $contLang;
190 $this->authManager = $authManager;
191 $this->linkRenderer = $linkRenderer;
192 $this->nsInfo = $nsInfo;
193
194 // We don't use the PermissionManager anymore, but we need to be careful
195 // removing the parameter since this class is extended by GlobalPreferencesFactory
196 // in the GlobalPreferences extension, and that class uses it
197 $this->permissionManager = $permissionManager;
198
199 $this->logger = new NullLogger();
200 $this->languageConverter = $languageConverter;
201 $this->languageNameUtils = $languageNameUtils;
202 $this->hookRunner = new HookRunner( $hookContainer );
203
204 // Don't break GlobalPreferences, fall back to global state if missing services
205 // or if passed a UserOptionsLookup that isn't UserOptionsManager
206 $services = static function () {
207 // BC hack. Use a closure so this can be unit-tested.
209 };
210 $this->userOptionsManager = ( $userOptionsLookup instanceof UserOptionsManager )
211 ? $userOptionsLookup
212 : $services()->getUserOptionsManager();
213 $this->languageConverterFactory = $languageConverterFactory ?? $services()->getLanguageConverterFactory();
214
215 $this->parserFactory = $parserFactory ?? $services()->getParserFactory();
216 $this->skinFactory = $skinFactory ?? $services()->getSkinFactory();
217 $this->userGroupManager = $userGroupManager ?? $services()->getUserGroupManager();
218 $this->signatureValidatorFactory = $signatureValidatorFactory
219 ?? $services()->getSignatureValidatorFactory();
220 }
221
225 public function getSaveBlacklist() {
226 return [
227 'realname',
228 'emailaddress',
229 ];
230 }
231
237 public function getFormDescriptor( User $user, IContextSource $context ) {
238 $preferences = [];
239
240 OutputPage::setupOOUI(
241 strtolower( $context->getSkin()->getSkinName() ),
242 $context->getLanguage()->getDir()
243 );
244
245 $this->profilePreferences( $user, $context, $preferences );
246 $this->skinPreferences( $user, $context, $preferences );
247 $this->datetimePreferences( $user, $context, $preferences );
248 $this->filesPreferences( $context, $preferences );
249 $this->renderingPreferences( $user, $context, $preferences );
250 $this->editingPreferences( $user, $context, $preferences );
251 $this->rcPreferences( $user, $context, $preferences );
252 $this->watchlistPreferences( $user, $context, $preferences );
253 $this->searchPreferences( $context, $preferences );
254
255 $this->hookRunner->onGetPreferences( $user, $preferences );
256
257 $this->loadPreferenceValues( $user, $context, $preferences );
258 $this->logger->debug( "Created form descriptor for user '{$user->getName()}'" );
259 return $preferences;
260 }
261
268 public static function simplifyFormDescriptor( array $descriptor ) {
269 foreach ( $descriptor as $name => &$params ) {
270 // Info fields are useless and can use complicated closure to provide
271 // text, skip all of them.
272 if ( ( isset( $params['type'] ) && $params['type'] === 'info' ) ||
273 // Checking old alias for compatibility with unchanged extensions
274 ( isset( $params['class'] ) && $params['class'] === 'HTMLInfoField' ) ||
275 ( isset( $params['class'] ) && $params['class'] === HTMLInfoField::class )
276 ) {
277 unset( $descriptor[$name] );
278 continue;
279 }
280 // Message parsing is the heaviest load when constructing the field,
281 // but we just want to validate data.
282 foreach ( $params as $key => $value ) {
283 switch ( $key ) {
284 // Special case, should be kept.
285 case 'options-message':
286 break;
287 // Special case, should be transferred.
288 case 'options-messages':
289 unset( $params[$key] );
290 $params['options'] = $value;
291 break;
292 default:
293 if ( preg_match( '/-messages?$/', $key ) ) {
294 // Unwanted.
295 unset( $params[$key] );
296 }
297 }
298 }
299 }
300 return $descriptor;
301 }
302
310 private function loadPreferenceValues( User $user, IContextSource $context, &$defaultPreferences ) {
311 // Remove preferences that wikis don't want to use
312 foreach ( $this->options->get( MainConfigNames::HiddenPrefs ) as $pref ) {
313 unset( $defaultPreferences[$pref] );
314 }
315
316 // For validation.
317 $simplified = self::simplifyFormDescriptor( $defaultPreferences );
318 $form = new HTMLForm( $simplified, $context );
319
320 $disable = !$user->isAllowed( 'editmyoptions' );
321
322 $defaultOptions = $this->userOptionsManager->getDefaultOptions( $user );
323 $userOptions = $this->userOptionsManager->getOptions( $user );
324 $this->applyFilters( $userOptions, $defaultPreferences, 'filterForForm' );
325 // Add in defaults from the user
326 foreach ( $simplified as $name => $_ ) {
327 $info = &$defaultPreferences[$name];
328 if ( $disable && !in_array( $name, $this->getSaveBlacklist() ) ) {
329 $info['disabled'] = 'disabled';
330 }
331 if ( isset( $info['default'] ) ) {
332 // Already set, no problem
333 continue;
334 }
335 $field = $form->getField( $name );
336 $globalDefault = $defaultOptions[$name] ?? null;
337 $prefFromUser = static::getPreferenceForField( $name, $field, $userOptions );
338
339 // If it validates, set it as the default
340 // FIXME: That's not how the validate() function works! Values of nested fields
341 // (e.g. CheckMatrix) would be missing.
342 if ( $prefFromUser !== null && // Make sure we're not just pulling nothing
343 $field->validate( $prefFromUser, $this->userOptionsManager->getOptions( $user ) ) === true ) {
344 $info['default'] = $prefFromUser;
345 } elseif ( $field->validate( $globalDefault, $this->userOptionsManager->getOptions( $user ) ) === true ) {
346 $info['default'] = $globalDefault;
347 } else {
348 $globalDefault = json_encode( $globalDefault );
349 throw new UnexpectedValueException(
350 "Default '$globalDefault' is invalid for preference $name of user " . $user->getName()
351 );
352 }
353 }
354
355 return $defaultPreferences;
356 }
357
368 public static function getPreferenceForField( $name, HTMLFormField $field, array $userOptions ) {
369 $val = $userOptions[$name] ?? null;
370
371 if ( $field instanceof HTMLNestedFilterable ) {
372 $val = [];
373 $prefix = $field->mParams['prefix'] ?? $name;
374 // Fetch all possible preference keys of the given field on this wiki.
375 $keys = array_keys( $field->filterDataForSubmit( [] ) );
376 foreach ( $keys as $key ) {
377 if ( $userOptions[$prefix . $key] ?? false ) {
378 $val[] = $key;
379 }
380 }
381 }
382
383 return $val;
384 }
385
395 protected function getOptionFromUser( $name, $info, array $userOptions ) {
396 $val = $userOptions[$name] ?? null;
397
398 // Handling for multiselect preferences
399 if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
400 // Checking old alias for compatibility with unchanged extensions
401 ( isset( $info['class'] ) && $info['class'] === 'HTMLMultiSelectField' ) ||
402 ( isset( $info['class'] ) && $info['class'] === HTMLMultiSelectField::class )
403 ) {
404 $options = HTMLFormField::flattenOptions( $info['options-messages'] ?? $info['options'] );
405 $prefix = $info['prefix'] ?? $name;
406 $val = [];
407
408 foreach ( $options as $value ) {
409 if ( $userOptions["$prefix$value"] ?? false ) {
410 $val[] = $value;
411 }
412 }
413 }
414
415 // Handling for checkmatrix preferences
416 if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
417 // Checking old alias for compatibility with unchanged extensions
418 ( isset( $info['class'] ) && $info['class'] === 'HTMLCheckMatrix' ) ||
419 ( isset( $info['class'] ) && $info['class'] === HTMLCheckMatrix::class )
420 ) {
421 $columns = HTMLFormField::flattenOptions( $info['columns'] );
422 $rows = HTMLFormField::flattenOptions( $info['rows'] );
423 $prefix = $info['prefix'] ?? $name;
424 $val = [];
425
426 foreach ( $columns as $column ) {
427 foreach ( $rows as $row ) {
428 if ( $userOptions["$prefix$column-$row"] ?? false ) {
429 $val[] = "$column-$row";
430 }
431 }
432 }
433 }
434
435 return $val;
436 }
437
445 protected function profilePreferences(
446 User $user, IContextSource $context, &$defaultPreferences
447 ) {
448 // retrieving user name for GENDER and misc.
449 $userName = $user->getName();
450
451 // Information panel
452 $defaultPreferences['username'] = [
453 'type' => 'info',
454 'label-message' => [ 'username', $userName ],
455 'default' => $userName,
456 'section' => 'personal/info',
457 ];
458
459 $lang = $context->getLanguage();
460
461 // Get groups to which the user belongs, Skip the default * group, seems useless here
462 $userEffectiveGroups = array_diff(
463 $this->userGroupManager->getUserEffectiveGroups( $user ),
464 [ '*' ]
465 );
466 $defaultPreferences['usergroups'] = [
467 'type' => 'info',
468 'label-message' => [ 'prefs-memberingroups',
469 Message::numParam( count( $userEffectiveGroups ) ), $userName ],
470 'default' => function () use ( $user, $userEffectiveGroups, $context ) {
471 return $this->renderUserGroupList( $user, $userEffectiveGroups, $context );
472 },
473 'raw' => true,
474 'section' => 'personal/info',
475 ];
476
477 $userDisabledGroups = $this->userGroupManager->getUserDisabledGroups( $user );
478 if ( $userDisabledGroups ) {
479 $conditionsLink = SpecialPage::getTitleFor(
480 'Listgrouprights', false,
482 )->getFullText();
483 $defaultPreferences['usergroups-disabled'] = [
484 'type' => 'info',
485 'label-message' => [ 'prefs-memberingroupsdisabled',
486 Message::numParam( count( $userDisabledGroups ) ), $userName ],
487 'default' => function () use ( $user, $userDisabledGroups, $context ) {
488 return $this->renderUserGroupList( $user, $userDisabledGroups, $context );
489 },
490 'help-message' => [ 'prefs-memberingroupsdisabled-help',
491 Message::numParam( count( $userDisabledGroups ) ), $user->getName(), $conditionsLink ],
492 'raw' => true,
493 'section' => 'personal/info',
494 ];
495 }
496
497 $contribTitle = SpecialPage::getTitleFor( "Contributions", $userName );
498 $formattedEditCount = $lang->formatNum( $user->getEditCount() );
499 $editCount = $this->linkRenderer->makeLink( $contribTitle, $formattedEditCount );
500
501 $defaultPreferences['editcount'] = [
502 'type' => 'info',
503 'raw' => true,
504 'label-message' => 'prefs-edits',
505 'default' => $editCount,
506 'section' => 'personal/info',
507 ];
508
509 if ( $user->getRegistration() ) {
510 $displayUser = $context->getUser();
511 $userRegistration = $user->getRegistration();
512 $defaultPreferences['registrationdate'] = [
513 'type' => 'info',
514 'label-message' => 'prefs-registration',
515 'default' => $context->msg(
516 'prefs-registration-date-time',
517 $lang->userTimeAndDate( $userRegistration, $displayUser ),
518 $lang->userDate( $userRegistration, $displayUser ),
519 $lang->userTime( $userRegistration, $displayUser )
520 )->text(),
521 'section' => 'personal/info',
522 ];
523 }
524
525 $canViewPrivateInfo = $user->isAllowed( 'viewmyprivateinfo' );
526 $canEditPrivateInfo = $user->isAllowed( 'editmyprivateinfo' );
527
528 // Actually changeable stuff
529 $defaultPreferences['realname'] = [
530 // (not really "private", but still shouldn't be edited without permission)
531 'type' => $canEditPrivateInfo && $this->authManager->allowsPropertyChange( 'realname' )
532 ? 'text' : 'info',
533 'default' => $user->getRealName(),
534 'section' => 'personal/info',
535 'label-message' => 'yourrealname',
536 'help-message' => 'prefs-help-realname',
537 ];
538
539 if ( $canEditPrivateInfo && $this->authManager->allowsAuthenticationDataChange(
540 new PasswordAuthenticationRequest(), false )->isGood()
541 ) {
542 $defaultPreferences['password'] = [
543 'type' => 'info',
544 'raw' => true,
545 'default' => (string)new ButtonWidget( [
546 'href' => SpecialPage::getTitleFor( 'ChangePassword' )->getLinkURL( [
547 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText()
548 ] ),
549 'label' => $context->msg( 'prefs-resetpass' )->text(),
550 ] ),
551 'label-message' => 'yourpassword',
552 // email password reset feature only works for users that have an email set up
553 'help-raw' => $user->getEmail()
554 ? $context->msg( 'prefs-help-yourpassword',
555 '[[#mw-prefsection-personal-email|{{int:prefs-email}}]]' )->parse()
556 : '',
557 'section' => 'personal/accountsecurity',
558 ];
559 }
560 // Only show prefershttps if secure login is turned on
561 if ( !$this->options->get( MainConfigNames::ForceHTTPS )
562 && $this->options->get( MainConfigNames::SecureLogin )
563 ) {
564 $defaultPreferences['prefershttps'] = [
565 'type' => 'toggle',
566 'label-message' => 'tog-prefershttps',
567 'help-message' => 'prefs-help-prefershttps',
568 'section' => 'personal/info'
569 ];
570 }
571
572 $defaultPreferences['downloaduserdata'] = [
573 'type' => 'info',
574 'raw' => true,
575 'label-message' => 'prefs-user-downloaddata-label',
576 'default' => Html::element(
577 'a',
578 [
579 'href' => $this->options->get( MainConfigNames::ScriptPath ) .
580 '/api.php?action=query&meta=userinfo&uiprop=*&formatversion=2',
581 ],
582 $context->msg( 'prefs-user-downloaddata-info' )->text()
583 ),
584 'help-message' => [ 'prefs-user-downloaddata-help-message', urlencode( $user->getTitleKey() ) ],
585 'section' => 'personal/info',
586 ];
587
588 $defaultPreferences['restoreprefs'] = [
589 'type' => 'info',
590 'raw' => true,
591 'label-message' => 'prefs-user-restoreprefs-label',
592 'default' => Html::element(
593 'a',
594 [
595 'href' => SpecialPage::getTitleFor( 'Preferences' )
596 ->getSubpage( 'reset' )->getLocalURL()
597 ],
598 $context->msg( 'prefs-user-restoreprefs-info' )->text()
599 ),
600 'section' => 'personal/info',
601 ];
602
603 $languages = $this->languageNameUtils->getLanguageNames(
604 LanguageNameUtils::AUTONYMS,
605 LanguageNameUtils::SUPPORTED
606 );
607 $languageCode = $this->options->get( MainConfigNames::LanguageCode );
608 if ( !array_key_exists( $languageCode, $languages ) ) {
609 $languages[$languageCode] = $languageCode;
610 // Sort the array again
611 ksort( $languages );
612 }
613
614 $options = [];
615 foreach ( $languages as $code => $name ) {
616 $options[$code] = $name;
617 }
618
619 $defaultPreferences['language'] = [
620 'type' => 'language',
621 'section' => 'personal/i18n',
622 'useCodex' => true,
623 'label-message' => 'yourlanguage',
624 'languages' => $options,
625 ];
626
627 $neutralGenderMessage = $context->msg( 'gender-notknown' )->escaped() . (
628 !$context->msg( 'gender-unknown' )->isDisabled()
629 ? "<br>" . $context->msg( 'parentheses' )
630 ->params( $context->msg( 'gender-unknown' )->plain() )
631 ->escaped()
632 : ''
633 );
634
635 $defaultPreferences['gender'] = [
636 'type' => 'radio',
637 'section' => 'personal/i18n',
638 'options' => [
639 $neutralGenderMessage => 'unknown',
640 $context->msg( 'gender-female' )->escaped() => 'female',
641 $context->msg( 'gender-male' )->escaped() => 'male',
642 ],
643 'label-message' => 'yourgender',
644 'help-message' => 'prefs-help-gender',
645 ];
646
647 // see if there are multiple language variants to choose from
648 if ( !$this->languageConverterFactory->isConversionDisabled() ) {
649
650 foreach ( LanguageConverter::$languagesWithVariants as $langCode ) {
651 if ( $langCode == $this->contLang->getCode() ) {
652 if ( !$this->languageConverter->hasVariants() ) {
653 continue;
654 }
655
656 $variants = $this->languageConverter->getVariants();
657 $variantArray = [];
658 foreach ( $variants as $v ) {
659 $v = str_replace( '_', '-', strtolower( $v ) );
660 $variantArray[$v] = $lang->getVariantname( $v, false );
661 }
662
663 $options = [];
664 foreach ( $variantArray as $code => $name ) {
665 $options[$code] = $name;
666 }
667
668 $defaultPreferences['variant'] = [
669 'label-message' => 'yourvariant',
670 'type' => 'language',
671 'section' => 'personal/i18n',
672 'help-message' => 'prefs-help-variant',
673 'useCodex' => true,
674 'languages' => $options,
675 ];
676 } else {
677 $defaultPreferences["variant-$langCode"] = [
678 'type' => 'api',
679 ];
680 }
681 }
682 }
683
684 // show a preview of the old signature first
685 $oldsigWikiText = $this->parserFactory->getInstance()->preSaveTransform(
686 '~~~',
687 $context->getTitle(),
688 $user,
689 ParserOptions::newFromContext( $context )
690 );
691 $oldsigHTML = Parser::stripOuterParagraph(
692 $context->getOutput()->parseAsContent( $oldsigWikiText )
693 );
694 $signatureFieldConfig = [];
695 // Validate existing signature and show a message about it
696 $signature = $this->userOptionsManager->getOption( $user, 'nickname' );
697 $useFancySig = $this->userOptionsManager->getBoolOption( $user, 'fancysig' );
698 if ( $useFancySig && $signature !== '' ) {
699 $parserOpts = ParserOptions::newFromContext( $context );
700 $validator = $this->signatureValidatorFactory
701 ->newSignatureValidator( $user, $context, $parserOpts );
702 $signatureErrors = $validator->validateSignature( $signature );
703 if ( $signatureErrors ) {
704 $sigValidation = $this->options->get( MainConfigNames::SignatureValidation );
705 $oldsigHTML .= '<p><strong>' .
706 // Messages used here:
707 // * prefs-signature-invalid-warning
708 // * prefs-signature-invalid-new
709 // * prefs-signature-invalid-disallow
710 $context->msg( "prefs-signature-invalid-$sigValidation" )->parse() .
711 '</strong></p>';
712
713 // On initial page load, show the warnings as well
714 // (when posting, you get normal validation errors instead)
715 foreach ( $signatureErrors as &$sigError ) {
716 $sigError = new HtmlSnippet( $sigError );
717 }
718 if ( !$context->getRequest()->wasPosted() ) {
719 $signatureFieldConfig = [
720 'warnings' => $sigValidation !== 'disallow' ? $signatureErrors : null,
721 'errors' => $sigValidation === 'disallow' ? $signatureErrors : null,
722 ];
723 }
724 }
725 }
726 $defaultPreferences['oldsig'] = [
727 'type' => 'info',
728 // Normally HTMLFormFields do not display warnings, so we need to use 'rawrow'
729 // and provide the entire OOUI\FieldLayout here
730 'rawrow' => true,
731 'default' => new FieldLayout(
732 new LabelWidget( [
733 'label' => new HtmlSnippet( $oldsigHTML ),
734 ] ),
735 [
736 'align' => 'top',
737 'label' => new HtmlSnippet( $context->msg( 'tog-oldsig' )->parse() )
738 ] + $signatureFieldConfig
739 ),
740 'section' => 'personal/signature',
741 ];
742 $defaultPreferences['nickname'] = [
743 'type' => $this->authManager->allowsPropertyChange( 'nickname' ) ? 'text' : 'info',
744 'maxlength' => $this->options->get( MainConfigNames::MaxSigChars ),
745 'label-message' => 'yournick',
746 'validation-callback' => function ( $signature, $alldata, HTMLForm $form ) {
747 return $this->validateSignature( $signature, $alldata, $form );
748 },
749 'section' => 'personal/signature',
750 'filter-callback' => function ( $signature, array $alldata, HTMLForm $form ) {
751 return $this->cleanSignature( $signature, $alldata, $form );
752 },
753 ];
754 $defaultPreferences['fancysig'] = [
755 'type' => 'toggle',
756 'label-message' => 'tog-fancysig',
757 // show general help about signature at the bottom of the section
758 'help-message' => 'prefs-help-signature',
759 'section' => 'personal/signature'
760 ];
761
762 // Email preferences
763 if ( $this->options->get( MainConfigNames::EnableEmail ) ) {
764 if ( $canViewPrivateInfo ) {
765 $helpMessages = [];
766 $helpMessages[] = $this->options->get( MainConfigNames::EmailConfirmToEdit )
767 ? 'prefs-help-email-required'
768 : 'prefs-help-email';
769
770 if ( $this->options->get( MainConfigNames::EnableUserEmail ) ) {
771 // additional messages when users can send email to each other
772 $helpMessages[] = 'prefs-help-email-others';
773 }
774
775 $emailAddress = $user->getEmail() ? htmlspecialchars( $user->getEmail() ) : '';
776 if ( $canEditPrivateInfo && $this->authManager->allowsPropertyChange( 'emailaddress' ) ) {
777 $button = new ButtonWidget( [
778 'href' => SpecialPage::getTitleFor( 'ChangeEmail' )->getLinkURL( [
779 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText()
780 ] ),
781 'label' =>
782 $context->msg( $user->getEmail() ? 'prefs-changeemail' : 'prefs-setemail' )->text(),
783 ] );
784
785 $emailAddress .= $emailAddress == '' ? $button : ( '<br />' . $button );
786 }
787
788 $defaultPreferences['emailaddress'] = [
789 'type' => 'info',
790 'raw' => true,
791 'default' => $emailAddress,
792 'label-message' => 'youremail',
793 'section' => 'personal/email',
794 'help-messages' => $helpMessages,
795 // 'cssclass' chosen below
796 ];
797 }
798
799 $disableEmailPrefs = false;
800
801 $defaultPreferences['requireemail'] = [
802 'type' => 'toggle',
803 'label-message' => 'tog-requireemail',
804 'help-message' => 'prefs-help-requireemail',
805 'section' => 'personal/email',
806 'disabled' => !$user->getEmail(),
807 ];
808
809 if ( $this->options->get( MainConfigNames::EmailAuthentication ) ) {
810 if ( $user->getEmail() ) {
811 if ( $user->getEmailAuthenticationTimestamp() ) {
812 // date and time are separate parameters to facilitate localisation.
813 // $time is kept for backward compat reasons.
814 // 'emailauthenticated' is also used in SpecialConfirmemail.php
815 $displayUser = $context->getUser();
816 $emailTimestamp = $user->getEmailAuthenticationTimestamp();
817 $time = $lang->userTimeAndDate( $emailTimestamp, $displayUser );
818 $d = $lang->userDate( $emailTimestamp, $displayUser );
819 $t = $lang->userTime( $emailTimestamp, $displayUser );
820 $emailauthenticated = $context->msg( 'emailauthenticated',
821 $time, $d, $t )->parse() . '<br />';
822 $emailauthenticationclass = 'mw-email-authenticated';
823 } else {
824 $disableEmailPrefs = true;
825 $emailauthenticated = $context->msg( 'emailnotauthenticated' )->parse() . '<br />' .
826 new ButtonWidget( [
827 'href' => SpecialPage::getTitleFor( 'Confirmemail' )->getLinkURL(),
828 'label' => $context->msg( 'emailconfirmlink' )->text(),
829 ] );
830 $emailauthenticationclass = "mw-email-not-authenticated";
831 }
832 } else {
833 $disableEmailPrefs = true;
834 $emailauthenticated = $context->msg( 'noemailprefs' )->escaped();
835 $emailauthenticationclass = 'mw-email-none';
836 }
837
838 if ( $canViewPrivateInfo ) {
839 $defaultPreferences['emailauthentication'] = [
840 'type' => 'info',
841 'raw' => true,
842 'section' => 'personal/email',
843 'label-message' => 'prefs-emailconfirm-label',
844 'default' => $emailauthenticated,
845 // Apply the same CSS class used on the input to the message:
846 'cssclass' => $emailauthenticationclass,
847 ];
848 }
849 }
850
851 if ( $this->options->get( MainConfigNames::EnableUserEmail ) &&
852 $user->isAllowed( 'sendemail' )
853 ) {
854 $defaultPreferences['disablemail'] = [
855 'id' => 'wpAllowEmail',
856 'type' => 'toggle',
857 'invert' => true,
858 'section' => 'personal/email',
859 'label-message' => 'allowemail',
860 'disabled' => $disableEmailPrefs,
861 ];
862
863 $defaultPreferences['email-allow-new-users'] = [
864 'id' => 'wpAllowEmailFromNewUsers',
865 'type' => 'toggle',
866 'section' => 'personal/email',
867 'label-message' => 'email-allow-new-users-label',
868 'help-message' => 'prefs-help-email-allow-new-users',
869 'disabled' => $disableEmailPrefs,
870 'disable-if' => [ '!==', 'disablemail', '1' ],
871 ];
872
873 $defaultPreferences['ccmeonemails'] = [
874 'type' => 'toggle',
875 'section' => 'personal/email',
876 'label-message' => 'tog-ccmeonemails',
877 'disabled' => $disableEmailPrefs,
878 ];
879
880 $defaultPreferences['email-blacklist'] = [
881 'type' => 'usersmultiselect',
882 'label-message' => 'email-mutelist-label',
883 'section' => 'personal/email',
884 'disabled' => $disableEmailPrefs,
885 'filter' => MultiUsernameFilter::class,
886 'excludetemp' => true,
887 ];
888 }
889
890 if ( $this->options->get( MainConfigNames::EnotifWatchlist ) ) {
891 $defaultPreferences['enotifwatchlistpages'] = [
892 'type' => 'toggle',
893 'section' => 'personal/email',
894 'label-message' => 'tog-enotifwatchlistpages',
895 'disabled' => $disableEmailPrefs,
896 ];
897 }
898 if ( $this->options->get( MainConfigNames::EnotifUserTalk ) ) {
899 $defaultPreferences['enotifusertalkpages'] = [
900 'type' => 'toggle',
901 'section' => 'personal/email',
902 'label-message' => 'tog-enotifusertalkpages',
903 'disabled' => $disableEmailPrefs,
904 ];
905 }
906 if ( $this->options->get( MainConfigNames::EnotifUserTalk ) ||
907 $this->options->get( MainConfigNames::EnotifWatchlist ) ) {
908 if ( $this->options->get( MainConfigNames::EnotifMinorEdits ) ) {
909 $defaultPreferences['enotifminoredits'] = [
910 'type' => 'toggle',
911 'section' => 'personal/email',
912 'label-message' => 'tog-enotifminoredits',
913 'disabled' => $disableEmailPrefs,
914 ];
915 }
916
917 if ( $this->options->get( MainConfigNames::EnotifRevealEditorAddress ) ) {
918 $defaultPreferences['enotifrevealaddr'] = [
919 'type' => 'toggle',
920 'section' => 'personal/email',
921 'label-message' => 'tog-enotifrevealaddr',
922 'disabled' => $disableEmailPrefs,
923 ];
924 }
925 }
926 }
927 }
928
935 protected function skinPreferences( User $user, IContextSource $context, &$defaultPreferences ) {
936 // Skin selector, if there is at least one valid skin
937 $validSkinNames = $this->getValidSkinNames( $user, $context );
938 if ( $validSkinNames ) {
939 $defaultPreferences['skin'] = [
940 // @phan-suppress-next-line SecurityCheck-XSS False +ve, label is escaped in generateSkinOptions()
941 'type' => 'radio',
942 'options' => $this->generateSkinOptions( $user, $context, $validSkinNames ),
943 'section' => 'rendering/skin',
944 ];
945 $defaultPreferences['skin-responsive'] = [
946 'type' => 'check',
947 'label-message' => 'prefs-skin-responsive',
948 'section' => 'rendering/skin/skin-prefs',
949 'help-message' => 'prefs-help-skin-responsive',
950 ];
951 }
952
953 $allowUserCss = $this->options->get( MainConfigNames::AllowUserCss );
954 $allowUserJs = $this->options->get( MainConfigNames::AllowUserJs );
955 $safeMode = $this->userOptionsManager->getOption( $user, 'forcesafemode' );
956 // Create links to user CSS/JS pages for all skins.
957 // This code is basically copied from generateSkinOptions().
958 // @todo Refactor this and the similar code in generateSkinOptions().
959 if ( $allowUserCss || $allowUserJs ) {
960 if ( $safeMode ) {
961 $defaultPreferences['customcssjs-safemode'] = [
962 'type' => 'info',
963 'raw' => true,
964 'rawrow' => true,
965 'section' => 'rendering/skin',
966 'default' => new FieldLayout(
967 new MessageWidget( [
968 'label' => new HtmlSnippet( $context->msg( 'prefs-custom-cssjs-safemode' )->parse() ),
969 'type' => 'warning',
970 ] )
971 ),
972 ];
973 } else {
974 $linkTools = [];
975 $userName = $user->getName();
976
977 if ( $allowUserCss ) {
978 $cssPage = Title::makeTitleSafe( NS_USER, $userName . '/common.css' );
979 $cssLinkText = $context->msg( 'prefs-custom-css' )->text();
980 $linkTools[] = $this->linkRenderer->makeLink( $cssPage, $cssLinkText );
981 }
982
983 if ( $allowUserJs ) {
984 $jsPage = Title::makeTitleSafe( NS_USER, $userName . '/common.js' );
985 $jsLinkText = $context->msg( 'prefs-custom-js' )->text();
986 $linkTools[] = $this->linkRenderer->makeLink( $jsPage, $jsLinkText );
987 }
988
989 $defaultPreferences['commoncssjs'] = [
990 'type' => 'info',
991 'raw' => true,
992 'default' => $context->getLanguage()->pipeList( $linkTools ),
993 'label-message' => 'prefs-common-config',
994 'section' => 'rendering/skin',
995 ];
996 }
997 }
998 }
999
1004 protected function filesPreferences( IContextSource $context, &$defaultPreferences ) {
1005 $defaultPreferences['imagesize'] = [
1006 'type' => 'select',
1007 'options' => $this->getImageSizes( $context ),
1008 'label-message' => 'imagemaxsize',
1009 'section' => 'rendering/files',
1010 ];
1012 $this->options->get( MainConfigNames::ThumbLimits ),
1013 $this->userOptionsManager->getDefaultOptions()
1014 );
1015 $defaultPreferences['thumbsize'] = [
1016 'type' => 'select',
1017 'options' => $this->getThumbSizes( $context ),
1018 'label-message' => 'thumbsize',
1019 'help' => $context->msg( 'thumbsize-help' )->params( $sizes[ 1 ] ),
1020 'section' => 'rendering/files',
1021 ];
1022 $user = $context->getUser();
1023 $limits = $this->options->get( MainConfigNames::ThumbLimits );
1024 $currentSize = $limits[ $this->userOptionsManager->getOption( $user, 'thumbsize' ) ];
1025 // Correct legacy values in next save (can be removed once T376152 is resolved)
1026 if ( !in_array( $currentSize, $sizes ) ) {
1027 // using a non-standard preference so map to the closest.
1028 $closestSize = $limits[1];
1029 if ( $currentSize < $limits[0] ) {
1030 $closestSize = $limits[0];
1031 } elseif ( $currentSize > $limits[1] ) {
1032 $closestSize = $limits[2];
1033 }
1034 $defaultPreferences['thumbsize']['default'] = array_search( $closestSize, $limits );
1035 }
1036 }
1037
1044 protected function datetimePreferences(
1045 User $user, IContextSource $context, &$defaultPreferences
1046 ) {
1047 $dateOptions = $this->getDateOptions( $context );
1048 if ( $dateOptions ) {
1049 $defaultPreferences['date'] = [
1050 'type' => 'radio',
1051 'options' => $dateOptions,
1052 'section' => 'rendering/dateformat',
1053 ];
1054 }
1055
1056 // Info
1057 $now = wfTimestampNow();
1058 $lang = $context->getLanguage();
1059 $nowlocal = Html::element( 'span', [ 'id' => 'wpLocalTime' ],
1060 $lang->userTime( $now, $user ) );
1061 $nowserver = $lang->userTime( $now, $user,
1062 [ 'format' => false, 'timecorrection' => false ] ) .
1063 Html::hidden( 'wpServerTime', (int)substr( $now, 8, 2 ) * 60 + (int)substr( $now, 10, 2 ) );
1064
1065 $defaultPreferences['nowserver'] = [
1066 'type' => 'info',
1067 'raw' => 1,
1068 'label-message' => 'servertime',
1069 'default' => $nowserver,
1070 'section' => 'rendering/timeoffset',
1071 ];
1072
1073 $defaultPreferences['nowlocal'] = [
1074 'type' => 'info',
1075 'raw' => 1,
1076 'label-message' => 'localtime',
1077 'default' => $nowlocal,
1078 'section' => 'rendering/timeoffset',
1079 ];
1080
1081 $userTimeCorrection = (string)$this->userOptionsManager->getOption( $user, 'timecorrection' );
1082 // This value should already be normalized by UserTimeCorrection, so it should always be valid and not
1083 // in the legacy format. However, let's be sure about that and normalize it again.
1084 // Also, recompute the offset because it can change with DST.
1085 $userTimeCorrectionObj = new UserTimeCorrection(
1086 $userTimeCorrection,
1087 null,
1088 $this->options->get( MainConfigNames::LocalTZoffset )
1089 );
1090
1091 if ( $userTimeCorrectionObj->getCorrectionType() === UserTimeCorrection::OFFSET ) {
1092 $tzDefault = UserTimeCorrection::formatTimezoneOffset( $userTimeCorrectionObj->getTimeOffset() );
1093 } else {
1094 $tzDefault = $userTimeCorrectionObj->toString();
1095 }
1096
1097 $defaultPreferences['timecorrection'] = [
1098 'type' => 'timezone',
1099 'label-message' => 'timezonelegend',
1100 'default' => $tzDefault,
1101 'size' => 20,
1102 'section' => 'rendering/timeoffset',
1103 'id' => 'wpTimeCorrection',
1104 'filter' => TimezoneFilter::class,
1105 ];
1106 }
1107
1113 protected function renderingPreferences(
1114 User $user,
1115 MessageLocalizer $l10n,
1116 &$defaultPreferences
1117 ) {
1118 // Diffs
1119 $defaultPreferences['diffonly'] = [
1120 'type' => 'toggle',
1121 'section' => 'rendering/diffs',
1122 'label-message' => 'tog-diffonly',
1123 ];
1124 $defaultPreferences['norollbackdiff'] = [
1125 'type' => 'toggle',
1126 'section' => 'rendering/diffs',
1127 'label-message' => 'tog-norollbackdiff',
1128 ];
1129 $defaultPreferences['diff-type'] = [
1130 'type' => 'api',
1131 ];
1132
1133 // Page Rendering
1134 if ( $this->options->get( MainConfigNames::AllowUserCssPrefs ) ) {
1135 $defaultPreferences['underline'] = [
1136 'type' => 'select',
1137 'options' => [
1138 $l10n->msg( 'underline-never' )->text() => 0,
1139 $l10n->msg( 'underline-always' )->text() => 1,
1140 $l10n->msg( 'underline-default' )->text() => 2,
1141 ],
1142 'label-message' => 'tog-underline',
1143 'section' => 'rendering/advancedrendering',
1144 ];
1145 }
1146
1147 $defaultPreferences['showhiddencats'] = [
1148 'type' => 'toggle',
1149 'section' => 'rendering/advancedrendering',
1150 'label-message' => 'tog-showhiddencats'
1151 ];
1152
1153 if ( $user->isAllowed( 'rollback' ) ) {
1154 $defaultPreferences['showrollbackconfirmation'] = [
1155 'type' => 'toggle',
1156 'section' => 'rendering/advancedrendering',
1157 'label-message' => 'tog-showrollbackconfirmation',
1158 ];
1159 }
1160
1161 $defaultPreferences['forcesafemode'] = [
1162 'type' => 'toggle',
1163 'section' => 'rendering/advancedrendering',
1164 'label-message' => 'tog-forcesafemode',
1165 'help-message' => 'prefs-help-forcesafemode'
1166 ];
1167 }
1168
1174 protected function editingPreferences( User $user, MessageLocalizer $l10n, &$defaultPreferences ) {
1175 $defaultPreferences['editsectiononrightclick'] = [
1176 'type' => 'toggle',
1177 'section' => 'editing/advancedediting',
1178 'label-message' => 'tog-editsectiononrightclick',
1179 ];
1180 $defaultPreferences['editondblclick'] = [
1181 'type' => 'toggle',
1182 'section' => 'editing/advancedediting',
1183 'label-message' => 'tog-editondblclick',
1184 ];
1185
1186 if ( $this->options->get( MainConfigNames::AllowUserCssPrefs ) ) {
1187 $defaultPreferences['editfont'] = [
1188 'type' => 'select',
1189 'section' => 'editing/editor',
1190 'label-message' => 'editfont-style',
1191 'options' => [
1192 $l10n->msg( 'editfont-monospace' )->text() => 'monospace',
1193 $l10n->msg( 'editfont-sansserif' )->text() => 'sans-serif',
1194 $l10n->msg( 'editfont-serif' )->text() => 'serif',
1195 ]
1196 ];
1197 }
1198
1199 if ( $user->isAllowed( 'minoredit' ) ) {
1200 $defaultPreferences['minordefault'] = [
1201 'type' => 'toggle',
1202 'section' => 'editing/editor',
1203 'label-message' => 'tog-minordefault',
1204 ];
1205 }
1206
1207 $defaultPreferences['forceeditsummary'] = [
1208 'type' => 'toggle',
1209 'section' => 'editing/editor',
1210 'label-message' => 'tog-forceeditsummary',
1211 ];
1212
1213 // T350653
1214 if ( $this->options->get( MainConfigNames::EnableEditRecovery ) ) {
1215 $defaultPreferences['editrecovery'] = [
1216 'type' => 'toggle',
1217 'section' => 'editing/editor',
1218 'label-message' => 'tog-editrecovery',
1219 'help-message' => [
1220 'tog-editrecovery-help',
1221 'https://meta.wikimedia.org/wiki/Talk:Community_Wishlist_Survey_2023/Edit-recovery_feature',
1222 ],
1223 ];
1224 }
1225
1226 $defaultPreferences['useeditwarning'] = [
1227 'type' => 'toggle',
1228 'section' => 'editing/editor',
1229 'label-message' => 'tog-useeditwarning',
1230 ];
1231
1232 $defaultPreferences['previewonfirst'] = [
1233 'type' => 'toggle',
1234 'section' => 'editing/preview',
1235 'label-message' => 'tog-previewonfirst',
1236 ];
1237 $defaultPreferences['previewontop'] = [
1238 'type' => 'toggle',
1239 'section' => 'editing/preview',
1240 'label-message' => 'tog-previewontop',
1241 ];
1242 $defaultPreferences['uselivepreview'] = [
1243 'type' => 'toggle',
1244 'section' => 'editing/preview',
1245 'label-message' => 'tog-uselivepreview',
1246 ];
1247 }
1248
1254 protected function rcPreferences( User $user, MessageLocalizer $l10n, &$defaultPreferences ) {
1255 $rcMaxAge = $this->options->get( MainConfigNames::RCMaxAge );
1256 $rcMax = ceil( $rcMaxAge / ( 3600 * 24 ) );
1257 $defaultPreferences['rcdays'] = [
1258 'type' => 'float',
1259 'label-message' => 'recentchangesdays',
1260 'section' => 'rc/displayrc',
1261 'min' => 1 / 24,
1262 'max' => $rcMax,
1263 'help-message' => [ 'recentchangesdays-max', Message::numParam( $rcMax ) ],
1264 ];
1265 $defaultPreferences['rclimit'] = [
1266 'type' => 'int',
1267 'min' => 1,
1268 'max' => 1000,
1269 'label-message' => 'recentchangescount',
1270 'help-message' => 'prefs-help-recentchangescount',
1271 'section' => 'rc/displayrc',
1272 'filter' => IntvalFilter::class,
1273 ];
1274 $defaultPreferences['usenewrc'] = [
1275 'type' => 'toggle',
1276 'label-message' => 'tog-usenewrc',
1277 'section' => 'rc/advancedrc',
1278 ];
1279 $defaultPreferences['hideminor'] = [
1280 'type' => 'toggle',
1281 'label-message' => 'tog-hideminor',
1282 'section' => 'rc/changesrc',
1283 ];
1284 $defaultPreferences['pst-cssjs'] = [
1285 'type' => 'api',
1286 ];
1287 $defaultPreferences['rcfilters-rc-collapsed'] = [
1288 'type' => 'api',
1289 ];
1290 $defaultPreferences['rcfilters-wl-collapsed'] = [
1291 'type' => 'api',
1292 ];
1293 $defaultPreferences['rcfilters-saved-queries'] = [
1294 'type' => 'api',
1295 ];
1296 $defaultPreferences['rcfilters-wl-saved-queries'] = [
1297 'type' => 'api',
1298 ];
1299 // Override RCFilters preferences for RecentChanges 'limit'
1300 $defaultPreferences['rcfilters-limit'] = [
1301 'type' => 'api',
1302 ];
1303 $defaultPreferences['rcfilters-saved-queries-versionbackup'] = [
1304 'type' => 'api',
1305 ];
1306 $defaultPreferences['rcfilters-wl-saved-queries-versionbackup'] = [
1307 'type' => 'api',
1308 ];
1309
1310 if ( $this->options->get( MainConfigNames::RCWatchCategoryMembership ) ) {
1311 $defaultPreferences['hidecategorization'] = [
1312 'type' => 'toggle',
1313 'label-message' => 'tog-hidecategorization',
1314 'section' => 'rc/changesrc',
1315 ];
1316 }
1317
1318 if ( $user->useRCPatrol() ) {
1319 $defaultPreferences['hidepatrolled'] = [
1320 'type' => 'toggle',
1321 'section' => 'rc/changesrc',
1322 'label-message' => 'tog-hidepatrolled',
1323 ];
1324 }
1325
1326 if ( $user->useNPPatrol() ) {
1327 $defaultPreferences['newpageshidepatrolled'] = [
1328 'type' => 'toggle',
1329 'section' => 'rc/changesrc',
1330 'label-message' => 'tog-newpageshidepatrolled',
1331 ];
1332 }
1333
1334 if ( $this->options->get( MainConfigNames::RCShowWatchingUsers ) ) {
1335 $defaultPreferences['shownumberswatching'] = [
1336 'type' => 'toggle',
1337 'section' => 'rc/advancedrc',
1338 'label-message' => 'tog-shownumberswatching',
1339 ];
1340 }
1341
1342 $defaultPreferences['rcenhancedfilters-disable'] = [
1343 'type' => 'toggle',
1344 'section' => 'rc/advancedrc',
1345 'label-message' => 'rcfilters-preference-label',
1346 'help-message' => 'rcfilters-preference-help',
1347 ];
1348 }
1349
1355 protected function watchlistPreferences(
1356 User $user, IContextSource $context, &$defaultPreferences
1357 ) {
1358 $watchlistdaysMax = ceil( $this->options->get( MainConfigNames::RCMaxAge ) / ( 3600 * 24 ) );
1359
1360 if ( $user->isAllowed( 'editmywatchlist' ) ) {
1361 $editWatchlistLinks = [];
1362 $editWatchlistModes = [
1363 'edit' => [ 'subpage' => false, 'flags' => [] ],
1364 'raw' => [ 'subpage' => 'raw', 'flags' => [] ],
1365 'clear' => [ 'subpage' => 'clear', 'flags' => [] ],
1366 ];
1367 foreach ( $editWatchlistModes as $mode => $options ) {
1368 // Messages: prefs-editwatchlist-edit, prefs-editwatchlist-raw, prefs-editwatchlist-clear
1369 $editWatchlistLinks[] =
1370 new ButtonWidget( [
1371 'href' => SpecialPage::getTitleFor( 'EditWatchlist', $options['subpage'] )->getLinkURL(),
1372 'flags' => $options[ 'flags' ],
1373 'label' => new HtmlSnippet(
1374 $context->msg( "prefs-editwatchlist-{$mode}" )->parse()
1375 ),
1376 ] );
1377 }
1378
1379 $defaultPreferences['editwatchlist'] = [
1380 'type' => 'info',
1381 'raw' => true,
1382 // Improve button spacing when they are wrapped (T353365)
1383 'default' => (string)new HorizontalLayout( [ 'items' => $editWatchlistLinks ] ),
1384 'label-message' => 'prefs-editwatchlist-label',
1385 'section' => 'watchlist/editwatchlist',
1386 ];
1387
1388 // If watchlist labels are enabled, show WatchlistLabels button
1389 if ( $this->options->get( MainConfigNames::EnableWatchlistLabels ) ) {
1390 $watchlistLabelsLink = new ButtonWidget( [
1391 'href' => SpecialPage::getTitleFor( 'WatchlistLabels' )->getLinkURL(),
1392 'label' => new HtmlSnippet(
1393 $context->msg( 'prefs-managewatchlistlabels' )->parse()
1394 ),
1395 ] );
1396
1397 $defaultPreferences['editwatchlistlabels'] = [
1398 'type' => 'info',
1399 'raw' => true,
1400 'default' => (string)$watchlistLabelsLink,
1401 'label-message' => 'prefs-editwatchlistlabels-label',
1402 'section' => 'watchlist/editwatchlist',
1403 ];
1404 }
1405
1406 }
1407
1408 $defaultPreferences['watchlistdays'] = [
1409 'type' => 'float',
1410 'min' => 1 / 24,
1411 'max' => $watchlistdaysMax,
1412 'section' => 'watchlist/displaywatchlist',
1413 'help-message' => [ 'prefs-watchlist-days-max', Message::numParam( $watchlistdaysMax ) ],
1414 'label-message' => 'prefs-watchlist-days',
1415 ];
1416 $defaultPreferences['wllimit'] = [
1417 'type' => 'int',
1418 'min' => 1,
1419 'max' => 1000,
1420 'label-message' => 'prefs-watchlist-edits',
1421 'help-message' => 'prefs-watchlist-edits-max',
1422 'section' => 'watchlist/displaywatchlist',
1423 'filter' => IntvalFilter::class,
1424 ];
1425 $defaultPreferences['extendwatchlist'] = [
1426 'type' => 'toggle',
1427 'section' => 'watchlist/advancedwatchlist',
1428 'label-message' => 'tog-extendwatchlist',
1429 ];
1430 $defaultPreferences['watchlisthideminor'] = [
1431 'type' => 'toggle',
1432 'section' => 'watchlist/changeswatchlist',
1433 'label-message' => 'tog-watchlisthideminor',
1434 ];
1435 $defaultPreferences['watchlisthidebots'] = [
1436 'type' => 'toggle',
1437 'section' => 'watchlist/changeswatchlist',
1438 'label-message' => 'tog-watchlisthidebots',
1439 ];
1440 $defaultPreferences['watchlisthideown'] = [
1441 'type' => 'toggle',
1442 'section' => 'watchlist/changeswatchlist',
1443 'label-message' => 'tog-watchlisthideown',
1444 ];
1445 $defaultPreferences['watchlisthideanons'] = [
1446 'type' => 'toggle',
1447 'section' => 'watchlist/changeswatchlist',
1448 'label-message' => 'tog-watchlisthideanons',
1449 ];
1450 $defaultPreferences['watchlisthideliu'] = [
1451 'type' => 'toggle',
1452 'section' => 'watchlist/changeswatchlist',
1453 'label-message' => 'tog-watchlisthideliu',
1454 ];
1455
1457 $defaultPreferences['watchlistreloadautomatically'] = [
1458 'type' => 'toggle',
1459 'section' => 'watchlist/advancedwatchlist',
1460 'label-message' => 'tog-watchlistreloadautomatically',
1461 ];
1462 }
1463
1464 $defaultPreferences['watchlistunwatchlinks'] = [
1465 'type' => 'toggle',
1466 'section' => 'watchlist/advancedwatchlist',
1467 'label-message' => 'tog-watchlistunwatchlinks',
1468 ];
1469
1470 if ( $this->options->get( MainConfigNames::RCWatchCategoryMembership ) ) {
1471 $defaultPreferences['watchlisthidecategorization'] = [
1472 'type' => 'toggle',
1473 'section' => 'watchlist/changeswatchlist',
1474 'label-message' => 'tog-watchlisthidecategorization',
1475 ];
1476 }
1477
1478 if ( $user->useRCPatrol() ) {
1479 $defaultPreferences['watchlisthidepatrolled'] = [
1480 'type' => 'toggle',
1481 'section' => 'watchlist/changeswatchlist',
1482 'label-message' => 'tog-watchlisthidepatrolled',
1483 ];
1484 }
1485
1486 if ( $this->options->get( MainConfigNames::WatchlistExpiry ) ) {
1487 $defaultPreferences["watchstar-expiry"] = [
1488 'type' => 'select',
1489 'options' => WatchAction::getExpiryOptionsFromMessage( $context ),
1490 'label-message' => "tog-watchstar-expiry",
1491 'section' => 'watchlist/pageswatchlist',
1492 ];
1493 }
1494
1495 $watchTypes = [
1496 'edit' => 'watchdefault',
1497 'move' => 'watchmoves',
1498 ];
1499
1500 // Kinda hacky
1501 if ( $user->isAllowedAny( 'createpage', 'createtalk' ) ) {
1502 $watchTypes['read'] = 'watchcreations';
1503 }
1504
1505 // Move uncommon actions to end of list
1506 $watchTypes += [
1507 'rollback' => 'watchrollback',
1508 'upload' => 'watchuploads',
1509 'delete' => 'watchdeletion',
1510 ];
1511
1512 foreach ( $watchTypes as $action => $pref ) {
1513 if ( $user->isAllowed( $action ) ) {
1514 // Messages:
1515 // tog-watchdefault, tog-watchmoves, tog-watchdeletion,
1516 // tog-watchcreations, tog-watchuploads, tog-watchrollback
1517 $defaultPreferences[$pref] = [
1518 'type' => 'toggle',
1519 'section' => 'watchlist/pageswatchlist',
1520 'label-message' => "tog-$pref",
1521 ];
1522
1523 if ( in_array( $action, [ 'edit', 'read', 'rollback' ] ) &&
1524 $this->options->get( MainConfigNames::WatchlistExpiry )
1525 ) {
1526 $defaultPreferences["$pref-expiry"] = [
1527 'type' => 'select',
1528 'options' => WatchAction::getExpiryOptionsFromMessage( $context ),
1529 'label-message' => "tog-watch-expiry",
1530 'section' => 'watchlist/pageswatchlist',
1531 'hide-if' => [ '!==', $pref, '1' ],
1532 'cssclass' => 'mw-prefs-indent',
1533 ];
1534 }
1535 }
1536 }
1537
1538 $defaultPreferences['watchlisttoken'] = [
1539 'type' => 'api',
1540 ];
1541
1542 // T408235
1543 $defaultPreferences['watchlistlabelonboarding'] = [
1544 'type' => 'api',
1545 ];
1546
1547 $tokenButton = new ButtonWidget( [
1548 'href' => SpecialPage::getTitleFor( 'ResetTokens' )->getLinkURL( [
1549 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText()
1550 ] ),
1551 'label' => $context->msg( 'prefs-watchlist-managetokens' )->text(),
1552 ] );
1553 $defaultPreferences['watchlisttoken-info'] = [
1554 'type' => 'info',
1555 'section' => 'watchlist/tokenwatchlist',
1556 'label-message' => 'prefs-watchlist-token',
1557 'help-message' => 'prefs-help-tokenmanagement',
1558 'raw' => true,
1559 'default' => (string)$tokenButton,
1560 ];
1561
1562 $defaultPreferences['wlenhancedfilters-disable'] = [
1563 'type' => 'toggle',
1564 'section' => 'watchlist/advancedwatchlist',
1565 'label-message' => 'rcfilters-watchlist-preference-label',
1566 'help-message' => 'rcfilters-watchlist-preference-help',
1567 ];
1568 }
1569
1574 protected function searchPreferences( $context, &$defaultPreferences ) {
1575 $defaultPreferences['search-special-page'] = [
1576 'type' => 'api',
1577 ];
1578
1579 foreach ( $this->nsInfo->getValidNamespaces() as $n ) {
1580 $defaultPreferences['searchNs' . $n] = [
1581 'type' => 'api',
1582 ];
1583 }
1584
1585 if ( $this->options->get( MainConfigNames::SearchMatchRedirectPreference ) ) {
1586 $defaultPreferences['search-match-redirect'] = [
1587 'type' => 'toggle',
1588 'section' => 'searchoptions/searchmisc',
1589 'label-message' => 'search-match-redirect-label',
1590 'help-message' => 'search-match-redirect-help',
1591 ];
1592 } else {
1593 $defaultPreferences['search-match-redirect'] = [
1594 'type' => 'api',
1595 ];
1596 }
1597
1598 $defaultPreferences['searchlimit'] = [
1599 'type' => 'int',
1600 'min' => 1,
1601 'max' => 500,
1602 'section' => 'searchoptions/searchmisc',
1603 'label-message' => 'searchlimit-label',
1604 'help-message' => $context->msg( 'searchlimit-help', 500 ),
1605 'filter' => IntvalFilter::class,
1606 ];
1607
1608 // show a preference for thumbnails from namespaces other than NS_FILE,
1609 // only when there they're actually configured to be served
1610 $thumbNamespaces = $this->options->get( MainConfigNames::ThumbnailNamespaces );
1611 $thumbNamespacesFormatted = array_combine(
1612 $thumbNamespaces,
1613 array_map(
1614 static function ( $namespaceId ) use ( $context ) {
1615 return $namespaceId === NS_MAIN
1616 ? $context->msg( 'blanknamespace' )->escaped()
1617 : $context->getLanguage()->getFormattedNsText( $namespaceId );
1618 },
1619 $thumbNamespaces
1620 )
1621 );
1622 $defaultThumbNamespacesFormatted =
1623 array_intersect_key( $thumbNamespacesFormatted, [ NS_FILE => 1 ] ) ?? [];
1624 $extraThumbNamespacesFormatted =
1625 array_diff_key( $thumbNamespacesFormatted, [ NS_FILE => 1 ] );
1626 if ( $extraThumbNamespacesFormatted ) {
1627 $defaultPreferences['search-thumbnail-extra-namespaces'] = [
1628 'type' => 'toggle',
1629 'section' => 'searchoptions/searchmisc',
1630 'label-message' => 'search-thumbnail-extra-namespaces-label',
1631 'help-message' => $context->msg(
1632 'search-thumbnail-extra-namespaces-message',
1633 Message::listParam( $extraThumbNamespacesFormatted ),
1634 count( $extraThumbNamespacesFormatted ),
1635 Message::listParam( $defaultThumbNamespacesFormatted ),
1636 count( $defaultThumbNamespacesFormatted )
1637 ),
1638 ];
1639 }
1640 }
1641
1651 private static function sortSkinNames( $a, $b, $currentSkin, $preferredSkins ) {
1652 // Display the current skin first in the list
1653 if ( strcasecmp( $a, $currentSkin ) === 0 ) {
1654 return -1;
1655 }
1656 if ( strcasecmp( $b, $currentSkin ) === 0 ) {
1657 return 1;
1658 }
1659 // Display preferred skins over other skins
1660 if ( count( $preferredSkins ) ) {
1661 $aPreferred = array_search( $a, $preferredSkins );
1662 $bPreferred = array_search( $b, $preferredSkins );
1663 // Cannot use ! operator because array_search returns the
1664 // index of the array item if found (i.e. 0) and false otherwise
1665 if ( $aPreferred !== false && $bPreferred === false ) {
1666 return -1;
1667 }
1668 if ( $aPreferred === false && $bPreferred !== false ) {
1669 return 1;
1670 }
1671 // When both skins are preferred, default to the ordering
1672 // specified by the preferred skins config array
1673 if ( $aPreferred !== false && $bPreferred !== false ) {
1674 return strcasecmp( $aPreferred, $bPreferred );
1675 }
1676 }
1677 // Use normal string comparison if both strings are not preferred
1678 return strcasecmp( $a, $b );
1679 }
1680
1689 private function getValidSkinNames( User $user, IContextSource $context ) {
1690 // Only show skins that aren't disabled
1691 $validSkinNames = $this->skinFactory->getAllowedSkins();
1692 $allInstalledSkins = $this->skinFactory->getInstalledSkins();
1693
1694 // Display the installed skin the user has specifically requested via useskin=….
1695 $useSkin = $context->getRequest()->getRawVal( 'useskin' );
1696 if ( $useSkin !== null && isset( $allInstalledSkins[$useSkin] )
1697 && $context->msg( "skinname-$useSkin" )->exists()
1698 ) {
1699 $validSkinNames[$useSkin] = $useSkin;
1700 }
1701
1702 // Display the skin if the user has set it as a preference already before it was hidden.
1703 $currentUserSkin = $this->userOptionsManager->getOption( $user, 'skin' );
1704 if ( isset( $allInstalledSkins[$currentUserSkin] )
1705 && $context->msg( "skinname-$currentUserSkin" )->exists()
1706 ) {
1707 $validSkinNames[$currentUserSkin] = $currentUserSkin;
1708 }
1709
1710 foreach ( $validSkinNames as $skinkey => &$skinname ) {
1711 $msg = $context->msg( "skinname-{$skinkey}" );
1712 if ( $msg->exists() ) {
1713 $skinname = htmlspecialchars( $msg->text() );
1714 }
1715 }
1716
1717 $preferredSkins = $this->options->get( MainConfigNames::SkinsPreferred );
1718 // Sort by the internal name, so that the ordering is the same for each display language,
1719 // especially if some skin names are translated to use a different alphabet and some are not.
1720 uksort( $validSkinNames, function ( $a, $b ) use ( $currentUserSkin, $preferredSkins ) {
1721 return $this->sortSkinNames( $a, $b, $currentUserSkin, $preferredSkins );
1722 } );
1723
1724 return $validSkinNames;
1725 }
1726
1735 private function renderUserGroupList(
1736 UserIdentity $user,
1737 array $userGroupsToShow,
1738 IContextSource $context
1739 ): string {
1740 $userGroupMemberships = $this->userGroupManager->getUserGroupMemberships( $user );
1741 $userGroups = $userMembers = $userTempGroups = $userTempMembers = [];
1742 foreach ( $userGroupsToShow as $ug ) {
1743 $groupStringOrObject = $userGroupMemberships[$ug] ?? $ug;
1744
1745 $userG = UserGroupMembership::getLinkHTML( $groupStringOrObject, $context );
1746 $userM = UserGroupMembership::getLinkHTML( $groupStringOrObject, $context, $user->getName() );
1747
1748 // Store expiring groups separately, so we can place them before non-expiring
1749 // groups in the list. This is to avoid the ambiguity of something like
1750 // "administrator, bureaucrat (until X date)" -- users might wonder whether the
1751 // expiry date applies to both groups, or just the last one
1752 if ( $groupStringOrObject instanceof UserGroupMembership &&
1753 $groupStringOrObject->getExpiry()
1754 ) {
1755 $userTempGroups[] = $userG;
1756 $userTempMembers[] = $userM;
1757 } else {
1758 $userGroups[] = $userG;
1759 $userMembers[] = $userM;
1760 }
1761 }
1762 sort( $userGroups );
1763 sort( $userMembers );
1764 sort( $userTempGroups );
1765 sort( $userTempMembers );
1766 $userGroups = array_merge( $userTempGroups, $userGroups );
1767 $userMembers = array_merge( $userTempMembers, $userMembers );
1768 $lang = $context->getLanguage();
1769 return $context->msg( 'prefs-memberingroups-type' )
1770 ->rawParams( $lang->commaList( $userGroups ), $lang->commaList( $userMembers ) )
1771 ->escaped();
1772 }
1773
1780 protected function generateSkinOptions( User $user, IContextSource $context, array $validSkinNames ) {
1781 $ret = [];
1782
1783 $mptitle = Title::newMainPage();
1784 $previewtext = $context->msg( 'skin-preview' )->escaped();
1785 $defaultSkin = $this->options->get( MainConfigNames::DefaultSkin );
1786 $allowUserCss = $this->options->get( MainConfigNames::AllowUserCss );
1787 $allowUserJs = $this->options->get( MainConfigNames::AllowUserJs );
1788 $safeMode = $this->userOptionsManager->getOption( $user, 'forcesafemode' );
1789 $foundDefault = false;
1790 foreach ( $validSkinNames as $skinkey => $sn ) {
1791 $linkTools = [];
1792
1793 // Mark the default skin
1794 if ( strcasecmp( $skinkey, $defaultSkin ) === 0 ) {
1795 $linkTools[] = $context->msg( 'default' )->escaped();
1796 $foundDefault = true;
1797 }
1798
1799 // Create talk page link if relevant message exists.
1800 $talkPageMsg = $context->msg( "$skinkey-prefs-talkpage" );
1801 if ( $talkPageMsg->exists() ) {
1802 $linkTools[] = $talkPageMsg->parse();
1803 }
1804
1805 // Create preview link
1806 $mplink = htmlspecialchars( $mptitle->getLocalURL( [ 'useskin' => $skinkey ] ) );
1807 $linkTools[] = "<a target='_blank' href=\"$mplink\">$previewtext</a>";
1808
1809 if ( !$safeMode ) {
1810 // Create links to user CSS/JS pages
1811 // @todo Refactor this and the similar code in skinPreferences().
1812 if ( $allowUserCss ) {
1813 $cssPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.css' );
1814 $cssLinkText = $context->msg( 'prefs-custom-css' )->text();
1815 $linkTools[] = $this->linkRenderer->makeLink( $cssPage, $cssLinkText );
1816 }
1817
1818 if ( $allowUserJs ) {
1819 $jsPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.js' );
1820 $jsLinkText = $context->msg( 'prefs-custom-js' )->text();
1821 $linkTools[] = $this->linkRenderer->makeLink( $jsPage, $jsLinkText );
1822 }
1823 }
1824
1825 $display = $sn . ' ' . $context->msg( 'parentheses' )
1826 ->rawParams( $context->getLanguage()->pipeList( $linkTools ) )
1827 ->escaped();
1828 $ret[$display] = $skinkey;
1829 }
1830
1831 if ( !$foundDefault ) {
1832 // If the default skin is not available, things are going to break horribly because the
1833 // default value for skin selector will not be a valid value. Let's just not show it then.
1834 return [];
1835 }
1836
1837 return $ret;
1838 }
1839
1844 protected function getDateOptions( IContextSource $context ) {
1845 $lang = $context->getLanguage();
1846 $dateopts = $lang->getDatePreferences();
1847
1848 $ret = [];
1849
1850 if ( $dateopts ) {
1851 if ( !in_array( 'default', $dateopts ) ) {
1852 $dateopts[] = 'default'; // Make sure default is always valid T21237
1853 }
1854
1855 // FIXME KLUGE: site default might not be valid for user language
1856 global $wgDefaultUserOptions;
1857 if ( !in_array( $wgDefaultUserOptions['date'], $dateopts ) ) {
1858 $wgDefaultUserOptions['date'] = 'default';
1859 }
1860
1861 $epoch = wfTimestampNow();
1862 foreach ( $dateopts as $key ) {
1863 if ( $key == 'default' ) {
1864 $formatted = $context->msg( 'datedefault' )->escaped();
1865 } else {
1866 $formatted = htmlspecialchars( $lang->timeanddate( $epoch, false, $key ) );
1867 }
1868 $ret[$formatted] = $key;
1869 }
1870 }
1871 return $ret;
1872 }
1873
1878 protected function getImageSizes( MessageLocalizer $l10n ) {
1879 $ret = [];
1880 $pixels = $l10n->msg( 'unit-pixel' )->text();
1881
1882 foreach ( $this->options->get( MainConfigNames::ImageLimits ) as $index => $limits ) {
1883 // Note: A left-to-right marker (U+200E) is inserted, see T144386
1884 $display = "{$limits[0]}\u{200E}×{$limits[1]}$pixels";
1885 $ret[$display] = $index;
1886 }
1887
1888 return $ret;
1889 }
1890
1906 public static function getNormalizedThumbSizes( array $limits, array $defaultUserOptions ) {
1907 $smallSize = max( 180, min( $limits ) );
1908 $defaultIndex = $defaultUserOptions[ 'thumbsize' ] ?? 0;
1909 $defaultSize = $limits[ $defaultIndex ];
1910 $largeSize = max( $limits );
1911 return [ $smallSize, $defaultSize, $largeSize ];
1912 }
1913
1918 protected function getThumbSizes( MessageLocalizer $l10n ) {
1919 $config = $this->options;
1920 $limits = $config->get( MainConfigNames::ThumbLimits );
1921 $sizes = self::getNormalizedThumbSizes( $limits, $this->userOptionsManager->getDefaultOptions() );
1922
1923 return [
1924 $l10n->msg( 'thumbsize-small' )->text() => array_search( $sizes[ 0 ], $limits ),
1925 $l10n->msg( 'thumbsize-regular' )->text() => array_search( $sizes[ 1 ], $limits ),
1926 $l10n->msg( 'thumbsize-large' )->text() => array_search( $sizes[ 2 ], $limits ),
1927 ];
1928 }
1929
1936 protected function validateSignature( $signature, $alldata, HTMLForm $form ) {
1937 $sigValidation = $this->options->get( MainConfigNames::SignatureValidation );
1938 $maxSigChars = $this->options->get( MainConfigNames::MaxSigChars );
1939 if ( is_string( $signature ) && mb_strlen( $signature ) > $maxSigChars ) {
1940 return $form->msg( 'badsiglength' )->numParams( $maxSigChars )->escaped();
1941 }
1942
1943 if ( $signature === null || $signature === '' ) {
1944 // Make sure leaving the field empty is valid, since that's used as the default (T288151).
1945 // Code using this preference in Parser::getUserSig() handles this case specially.
1946 return true;
1947 }
1948
1949 // Remaining checks only apply to fancy signatures
1950 if ( !( isset( $alldata['fancysig'] ) && $alldata['fancysig'] ) ) {
1951 return true;
1952 }
1953
1954 // HERE BE DRAGONS:
1955 //
1956 // If this value is already saved as the user's signature, treat it as valid, even if it
1957 // would be invalid to save now, and even if $wgSignatureValidation is set to 'disallow'.
1958 //
1959 // It can become invalid when we introduce new validation, or when the value just transcludes
1960 // some page containing the real signature and that page is edited (which we can't validate),
1961 // or when someone's username is changed.
1962 //
1963 // Otherwise it would be completely removed when the user opens their preferences page, which
1964 // would be very unfriendly.
1965 $user = $form->getUser();
1966 if (
1967 $signature === $this->userOptionsManager->getOption( $user, 'nickname' ) &&
1968 (bool)$alldata['fancysig'] === $this->userOptionsManager->getBoolOption( $user, 'fancysig' )
1969 ) {
1970 return true;
1971 }
1972
1973 if ( $sigValidation === 'new' || $sigValidation === 'disallow' ) {
1974 // Validate everything
1975 $parserOpts = ParserOptions::newFromContext( $form->getContext() );
1976 $validator = $this->signatureValidatorFactory
1977 ->newSignatureValidator( $user, $form->getContext(), $parserOpts );
1978 $errors = $validator->validateSignature( $signature );
1979 if ( $errors ) {
1980 return $errors;
1981 }
1982 }
1983
1984 // Quick check for mismatched HTML tags in the input.
1985 // Note that this is easily fooled by wikitext templates or bold/italic markup.
1986 // We're only keeping this until Parsoid is integrated and guaranteed to be available.
1987 if ( $this->parserFactory->getInstance()->validateSig( $signature ) === false ) {
1988 return $form->msg( 'badsig' )->escaped();
1989 }
1990
1991 return true;
1992 }
1993
2000 protected function cleanSignature( $signature, $alldata, HTMLForm $form ) {
2001 if ( isset( $alldata['fancysig'] ) && $alldata['fancysig'] ) {
2002 $signature = $this->parserFactory->getInstance()->cleanSig( $signature );
2003 } else {
2004 // When no fancy sig used, make sure ~{3,5} get removed.
2005 $signature = Parser::cleanSigInSig( $signature );
2006 }
2007
2008 return $signature;
2009 }
2010
2018 public function getForm(
2019 User $user,
2020 IContextSource $context,
2021 $formClass = PreferencesFormOOUI::class,
2022 array $remove = []
2023 ) {
2024 // We use ButtonWidgets in some of the getPreferences() functions
2025 $context->getOutput()->enableOOUI();
2026
2027 // Note that the $user parameter of getFormDescriptor() is deprecated.
2028 $formDescriptor = $this->getFormDescriptor( $user, $context );
2029 if ( count( $remove ) ) {
2030 $removeKeys = array_fill_keys( $remove, true );
2031 $formDescriptor = array_diff_key( $formDescriptor, $removeKeys );
2032 }
2033
2034 // Remove type=api preferences. They are not intended for rendering in the form.
2035 foreach ( $formDescriptor as $name => $info ) {
2036 if ( isset( $info['type'] ) && $info['type'] === 'api' ) {
2037 unset( $formDescriptor[$name] );
2038 }
2039 }
2040
2044 $htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );
2045
2046 // This allows users to opt-in to hidden skins. While this should be discouraged and is not
2047 // discoverable, this allows users to still use hidden skins while preventing new users from
2048 // adopting unsupported skins. If no useskin=… parameter was provided, it will not show up
2049 // in the resulting URL.
2050 $htmlForm->setAction( $context->getTitle()->getLocalURL( [
2051 'useskin' => $context->getRequest()->getRawVal( 'useskin' )
2052 ] ) );
2053
2054 $htmlForm->setModifiedUser( $user );
2055 $htmlForm->setOptionsEditable( $user->isAllowed( 'editmyoptions' ) );
2056 $htmlForm->setPrivateInfoEditable( $user->isAllowed( 'editmyprivateinfo' ) );
2057 $htmlForm->setId( 'mw-prefs-form' );
2058 $htmlForm->setAutocomplete( 'off' );
2059 $htmlForm->setSubmitTextMsg( 'saveprefs' );
2060 // Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save'
2061 $htmlForm->setSubmitTooltip( 'preferences-save' );
2062 $htmlForm->setSubmitID( 'prefcontrol' );
2063 $htmlForm->setSubmitCallback(
2064 function ( array $formData, PreferencesFormOOUI $form ) use ( $formDescriptor ) {
2065 return $this->submitForm( $formData, $form, $formDescriptor );
2066 }
2067 );
2068
2069 return $htmlForm;
2070 }
2071
2080 protected function saveFormData( $formData, PreferencesFormOOUI $form, array $formDescriptor ) {
2081 $user = $form->getModifiedUser();
2082 $hiddenPrefs = $this->options->get( MainConfigNames::HiddenPrefs );
2083 $result = true;
2084
2085 if ( !$user->isAllowedAny( 'editmyprivateinfo', 'editmyoptions' ) ) {
2086 return Status::newFatal( 'mypreferencesprotected' );
2087 }
2088
2089 // Filter input
2090 $this->applyFilters( $formData, $formDescriptor, 'filterFromForm' );
2091
2092 // Fortunately, the realname field is MUCH simpler
2093 // (not really "private", but still shouldn't be edited without permission)
2094
2095 if ( !in_array( 'realname', $hiddenPrefs )
2096 && $user->isAllowed( 'editmyprivateinfo' )
2097 && array_key_exists( 'realname', $formData )
2098 ) {
2099 $realName = $formData['realname'];
2100 $user->setRealName( $realName );
2101 }
2102
2103 if ( $user->isAllowed( 'editmyoptions' ) ) {
2104 $oldUserOptions = $this->userOptionsManager->getOptions( $user );
2105
2106 foreach ( $this->getSaveBlacklist() as $b ) {
2107 unset( $formData[$b] );
2108 }
2109
2110 // If users have saved a value for a preference which has subsequently been disabled
2111 // via $wgHiddenPrefs, we don't want to destroy that setting in case the preference
2112 // is subsequently re-enabled
2113 foreach ( $hiddenPrefs as $pref ) {
2114 // If the user has not set a non-default value here, the default will be returned
2115 // and subsequently discarded
2116 $formData[$pref] = $this->userOptionsManager->getOption( $user, $pref, null, true );
2117 }
2118
2119 // If the user changed the rclimit preference, also change the rcfilters-rclimit preference
2120 if (
2121 isset( $formData['rclimit'] ) &&
2122 intval( $formData[ 'rclimit' ] ) !== $this->userOptionsManager->getIntOption( $user, 'rclimit' )
2123 ) {
2124 $formData['rcfilters-limit'] = $formData['rclimit'];
2125 }
2126
2127 // Keep old preferences from interfering due to back-compat code, etc.
2128 $optionsToReset = $this->getOptionNamesForReset( $user, $form->getContext(), 'unused' );
2129 $this->userOptionsManager->resetOptionsByName( $user, $optionsToReset );
2130
2131 foreach ( $formData as $key => $value ) {
2132 // If we're creating a new local override, we need to explicitly pass
2133 // GLOBAL_OVERRIDE to setOption(), otherwise the update would be ignored
2134 // due to the conflicting global option.
2135 $except = !empty( $formData[$key . UserOptionsLookup::LOCAL_EXCEPTION_SUFFIX] );
2136 $this->userOptionsManager->setOption( $user, $key, $value,
2137 $except ? UserOptionsManager::GLOBAL_OVERRIDE : UserOptionsManager::GLOBAL_IGNORE );
2138 }
2139
2140 $this->hookRunner->onPreferencesFormPreSave(
2141 $formData, $form, $user, $result, $oldUserOptions );
2142 }
2143
2144 $user->saveSettings();
2145
2146 return $result;
2147 }
2148
2157 protected function applyFilters( array &$preferences, array $formDescriptor, $verb ) {
2158 foreach ( $formDescriptor as $preference => $desc ) {
2159 if ( !isset( $desc['filter'] ) || !isset( $preferences[$preference] ) ) {
2160 continue;
2161 }
2162 $filterDesc = $desc['filter'];
2163 if ( $filterDesc instanceof Filter ) {
2164 $filter = $filterDesc;
2165 } elseif ( class_exists( $filterDesc ) ) {
2166 $filter = new $filterDesc();
2167 } elseif ( is_callable( $filterDesc ) ) {
2168 $filter = $filterDesc();
2169 } else {
2170 throw new UnexpectedValueException(
2171 "Unrecognized filter type for preference '$preference'"
2172 );
2173 }
2174 $preferences[$preference] = $filter->$verb( $preferences[$preference] );
2175 }
2176 }
2177
2186 protected function submitForm(
2187 array $formData,
2188 PreferencesFormOOUI $form,
2189 array $formDescriptor
2190 ) {
2191 $res = $this->saveFormData( $formData, $form, $formDescriptor );
2192
2193 if ( $res === true ) {
2194 $context = $form->getContext();
2195 $urlOptions = [];
2196
2197 $urlOptions += $form->getExtraSuccessRedirectParameters();
2198
2199 $url = $form->getTitle()->createFragmentTarget(
2200 $form->getRequest()->getVal( 'returntoanchor' ) ?? ''
2201 )->getFullURL( $urlOptions );
2202
2203 // Set session data for the success message
2204 $context->getRequest()->getSession()->set( 'specialPreferencesSaveSuccess', 1 );
2205
2206 $context->getOutput()->redirect( $url );
2207 }
2208
2209 return ( $res === true ? Status::newGood() : $res );
2210 }
2211
2218 public function getResetKinds(
2219 User $user, IContextSource $context, $options = null
2220 ): array {
2221 $options ??= $this->userOptionsManager->loadUserOptions( $user );
2222
2223 $prefs = $this->getFormDescriptor( $user, $context );
2224 $mapping = [];
2225
2226 // Pull out the "special" options, so they don't get converted as
2227 // multiselect or checkmatrix.
2228 $specialOptions = array_fill_keys( $this->getSaveBlacklist(), true );
2229 foreach ( $specialOptions as $name => $value ) {
2230 unset( $prefs[$name] );
2231 }
2232
2233 // Multiselect and checkmatrix options are stored in the database with
2234 // one key per option, each having a boolean value. Extract those keys.
2235 $multiselectOptions = [];
2236 foreach ( $prefs as $name => $info ) {
2237 if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
2238 // Checking old alias for compatibility with unchanged extensions
2239 ( isset( $info['class'] ) && $info['class'] === 'HTMLMultiSelectField' ) ||
2240 ( isset( $info['class'] ) && $info['class'] === HTMLMultiSelectField::class )
2241 ) {
2242 $opts = HTMLFormField::flattenOptions( $info['options'] ?? $info['options-messages'] );
2243 $prefix = $info['prefix'] ?? $name;
2244
2245 foreach ( $opts as $value ) {
2246 $multiselectOptions["$prefix$value"] = true;
2247 }
2248
2249 unset( $prefs[$name] );
2250 }
2251 }
2252 $checkmatrixOptions = [];
2253 foreach ( $prefs as $name => $info ) {
2254 if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
2255 // Checking old alias for compatibility with unchanged extensions
2256 ( isset( $info['class'] ) && $info['class'] === 'HTMLCheckMatrix' ) ||
2257 ( isset( $info['class'] ) && $info['class'] === HTMLCheckMatrix::class )
2258 ) {
2259 $columns = HTMLFormField::flattenOptions( $info['columns'] );
2260 $rows = HTMLFormField::flattenOptions( $info['rows'] );
2261 $prefix = $info['prefix'] ?? $name;
2262
2263 foreach ( $columns as $column ) {
2264 foreach ( $rows as $row ) {
2265 $checkmatrixOptions["$prefix$column-$row"] = true;
2266 }
2267 }
2268
2269 unset( $prefs[$name] );
2270 }
2271 }
2272
2273 // $value is ignored
2274 foreach ( $options as $key => $value ) {
2275 if ( isset( $prefs[$key] ) ) {
2276 $mapping[$key] = 'registered';
2277 } elseif ( isset( $multiselectOptions[$key] ) ) {
2278 $mapping[$key] = 'registered-multiselect';
2279 } elseif ( isset( $checkmatrixOptions[$key] ) ) {
2280 $mapping[$key] = 'registered-checkmatrix';
2281 } elseif ( isset( $specialOptions[$key] ) ) {
2282 $mapping[$key] = 'special';
2283 } elseif ( str_starts_with( $key, 'userjs-' ) ) {
2284 $mapping[$key] = 'userjs';
2285 } elseif ( str_ends_with( $key, UserOptionsLookup::LOCAL_EXCEPTION_SUFFIX ) ) {
2286 $mapping[$key] = 'local-exception';
2287 } else {
2288 $mapping[$key] = 'unused';
2289 }
2290 }
2291
2292 return $mapping;
2293 }
2294
2295 public function listResetKinds(): array {
2296 return [
2297 'registered',
2298 'registered-multiselect',
2299 'registered-checkmatrix',
2300 'special',
2301 'userjs',
2302 'local-exception',
2303 'unused'
2304 ];
2305 }
2306
2313 public function getOptionNamesForReset( User $user, IContextSource $context, $kinds ) {
2314 $oldOptions = $this->userOptionsManager->loadUserOptions( $user, IDBAccessObject::READ_LATEST );
2315
2316 if ( !is_array( $kinds ) ) {
2317 $kinds = [ $kinds ];
2318 }
2319
2320 if ( in_array( 'all', $kinds ) ) {
2321 return array_keys( $oldOptions );
2322 } else {
2323 $optionKinds = $this->getResetKinds( $user, $context );
2324 $kinds = array_intersect( $kinds, $this->listResetKinds() );
2325 $optionNames = [];
2326
2327 foreach ( $oldOptions as $key => $value ) {
2328 if ( in_array( $optionKinds[$key], $kinds ) ) {
2329 $optionNames[] = $key;
2330 }
2331 }
2332 return $optionNames;
2333 }
2334 }
2335}
const NS_USER
Definition Defines.php:53
const NS_FILE
Definition Defines.php:57
const NS_MAIN
Definition Defines.php:51
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Page addition to a user's watchlist.
AuthManager is the authentication system in MediaWiki and serves entry point for authentication.
This is a value object for authentication requests with a username and password.
A class for passing options to services.
assertRequiredOptions(array $expectedKeys)
Assert that the list of options provided in this instance exactly match $expectedKeys,...
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage().
getContext()
Get the base IContextSource object.
A checkbox matrix Operates similarly to HTMLMultiSelectField, but instead of using an array of option...
An information field (text blob), not a proper input.
The parent class to generate form fields.
Object handling generic submission, CSRF protection, layout and other logic for UI forms in a reusabl...
Definition HTMLForm.php:214
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
This class is a collection of static functions that serve two purposes:
Definition Html.php:44
An interface for creating language converters.
Base class for multi-variant language conversion.
A service that provides utilities to do with language names and codes.
Base class for language-specific code.
Definition Language.php:65
Class that generates HTML for internal links.
A class containing constants representing the names of configuration variables.
const HiddenPrefs
Name constant for the HiddenPrefs setting, for use with Config\get().
const ForceHTTPS
Name constant for the ForceHTTPS setting, for use with Config\get().
const EnotifWatchlist
Name constant for the EnotifWatchlist setting, for use with Config\get().
const MaxSigChars
Name constant for the MaxSigChars setting, for use with Config\get().
const RCMaxAge
Name constant for the RCMaxAge setting, for use with Config\get().
const DefaultSkin
Name constant for the DefaultSkin setting, for use with Config\get().
const EnotifRevealEditorAddress
Name constant for the EnotifRevealEditorAddress setting, for use with Config\get().
const EnableUserEmail
Name constant for the EnableUserEmail setting, for use with Config\get().
const SkinsPreferred
Name constant for the SkinsPreferred setting, for use with Config\get().
const EnableWatchlistLabels
Name constant for the EnableWatchlistLabels setting, for use with Config\get().
const EnableEditRecovery
Name constant for the EnableEditRecovery setting, for use with Config\get().
const EmailConfirmToEdit
Name constant for the EmailConfirmToEdit setting, for use with Config\get().
const EnableEmail
Name constant for the EnableEmail setting, for use with Config\get().
const LocalTZoffset
Name constant for the LocalTZoffset setting, for use with Config\get().
const RCShowWatchingUsers
Name constant for the RCShowWatchingUsers setting, for use with Config\get().
const WatchlistExpiry
Name constant for the WatchlistExpiry setting, for use with Config\get().
const EnotifUserTalk
Name constant for the EnotifUserTalk setting, for use with Config\get().
const AllowUserJs
Name constant for the AllowUserJs setting, for use with Config\get().
const ImageLimits
Name constant for the ImageLimits setting, for use with Config\get().
const SearchMatchRedirectPreference
Name constant for the SearchMatchRedirectPreference setting, for use with Config\get().
const EnotifMinorEdits
Name constant for the EnotifMinorEdits setting, for use with Config\get().
const ScriptPath
Name constant for the ScriptPath setting, for use with Config\get().
const AllowUserCss
Name constant for the AllowUserCss setting, for use with Config\get().
const ThumbLimits
Name constant for the ThumbLimits setting, for use with Config\get().
const SecureLogin
Name constant for the SecureLogin setting, for use with Config\get().
const LanguageCode
Name constant for the LanguageCode setting, for use with Config\get().
const SignatureValidation
Name constant for the SignatureValidation setting, for use with Config\get().
const AllowUserCssPrefs
Name constant for the AllowUserCssPrefs setting, for use with Config\get().
const RCWatchCategoryMembership
Name constant for the RCWatchCategoryMembership setting, for use with Config\get().
const ThumbnailNamespaces
Name constant for the ThumbnailNamespaces setting, for use with Config\get().
const EmailAuthentication
Name constant for the EmailAuthentication setting, for use with Config\get().
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:144
string $key
The message key.
Definition Message.php:192
static listParam(array $list, $type=ListType::AND)
Definition Message.php:1355
This is one of the Core classes and should be read at least once by any new developers.
Set options of the Parser.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Definition Parser.php:139
A service class for checking permissions To obtain an instance, use MediaWikiServices\getInstance()->...
This is the default implementation of PreferencesFactory.
validateSignature( $signature, $alldata, HTMLForm $form)
rcPreferences(User $user, MessageLocalizer $l10n, &$defaultPreferences)
watchlistPreferences(User $user, IContextSource $context, &$defaultPreferences)
listResetKinds()
Return a list of the types of user options currently returned by getResetKinds().
profilePreferences(User $user, IContextSource $context, &$defaultPreferences)
renderingPreferences(User $user, MessageLocalizer $l10n, &$defaultPreferences)
getForm(User $user, IContextSource $context, $formClass=PreferencesFormOOUI::class, array $remove=[])
getOptionNamesForReset(User $user, IContextSource $context, $kinds)
skinPreferences(User $user, IContextSource $context, &$defaultPreferences)
static getNormalizedThumbSizes(array $limits, array $defaultUserOptions)
Normalizes thumbnail options (which can support more than 3 values) to min, default and max values fo...
__construct(ServiceOptions $options, Language $contLang, AuthManager $authManager, LinkRenderer $linkRenderer, NamespaceInfo $nsInfo, PermissionManager $permissionManager, ILanguageConverter $languageConverter, LanguageNameUtils $languageNameUtils, HookContainer $hookContainer, UserOptionsLookup $userOptionsLookup, ?LanguageConverterFactory $languageConverterFactory=null, ?ParserFactory $parserFactory=null, ?SkinFactory $skinFactory=null, ?UserGroupManager $userGroupManager=null, ?SignatureValidatorFactory $signatureValidatorFactory=null)
generateSkinOptions(User $user, IContextSource $context, array $validSkinNames)
static simplifyFormDescriptor(array $descriptor)
Simplify form descriptor for validation or something similar.
getResetKinds(User $user, IContextSource $context, $options=null)
editingPreferences(User $user, MessageLocalizer $l10n, &$defaultPreferences)
getOptionFromUser( $name, $info, array $userOptions)
Pull option from a user account.
datetimePreferences(User $user, IContextSource $context, &$defaultPreferences)
cleanSignature( $signature, $alldata, HTMLForm $form)
getSaveBlacklist()
Get the names of preferences that should never be saved (such as 'realname' and 'emailaddress')....
applyFilters(array &$preferences, array $formDescriptor, $verb)
Applies filters to preferences either before or after form usage.
static getPreferenceForField( $name, HTMLFormField $field, array $userOptions)
Get preference values for the 'default' param of html form descriptor, compatible with nested fields.
filesPreferences(IContextSource $context, &$defaultPreferences)
submitForm(array $formData, PreferencesFormOOUI $form, array $formDescriptor)
Save the form data and reload the page.
saveFormData( $formData, PreferencesFormOOUI $form, array $formDescriptor)
Handle the form submission if everything validated properly.
Factory class to create Skin objects.
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getExtraSuccessRedirectParameters()
Get extra parameters for the query string when redirecting after successful save.
List all defined user groups and the associated rights.
A special page that lists last changes made to the wiki, limited to user-defined list of titles.
static checkStructuredFilterUiEnabled(UserIdentity $user)
Static method to check whether StructuredFilter UI is enabled for the given user.1....
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:44
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Represents a title within MediaWiki.
Definition Title.php:69
Provides access to user options.
A service class to control user options.
Manage user group memberships.
Represents the membership of one user in one user group.
Utility class to parse the TimeCorrection string value.
User class for the MediaWiki software.
Definition User.php:129
isAllowed(string $permission, ?PermissionStatus $status=null)
Checks whether this authority has the given permission in general.
Definition User.php:2137
getRegistration()
Get the timestamp of account creation.
Definition User.php:3086
useRCPatrol()
Check whether to enable recent changes patrol features for this user.
Definition User.php:2145
isAllowedAny(... $permissions)
Checks whether this authority has any of the given permissions in general.Implementations must ensure...
Definition User.php:2128
getEditCount()
Get the user's edit count.
Definition User.php:2063
getRealName()
Get the user's real name.
Definition User.php:1944
getTitleKey()
Get the user's name escaped by underscores.
Definition User.php:1603
getEmailAuthenticationTimestamp()
Get the timestamp of the user's e-mail authentication.
Definition User.php:1861
useNPPatrol()
Check whether to enable new pages patrol features for this user.
Definition User.php:2155
getEmail()
Get the user's e-mail address.
Definition User.php:1848
getName()
Get the user name, or the IP of an anonymous user.
Definition User.php:1511
return[ 'config-schema-inverse'=>['default'=>['ConfigRegistry'=>['main'=> 'MediaWiki\\Config\\GlobalVarConfig::newInstance',], 'Sitename'=> 'MediaWiki', 'Server'=> false, 'CanonicalServer'=> false, 'ServerName'=> false, 'AssumeProxiesUseDefaultProtocolPorts'=> true, 'HttpsPort'=> 443, 'ForceHTTPS'=> false, 'ScriptPath'=> '/wiki', 'UsePathInfo'=> null, 'Script'=> false, 'LoadScript'=> false, 'RestPath'=> false, 'StylePath'=> false, 'LocalStylePath'=> false, 'ExtensionAssetsPath'=> false, 'ExtensionDirectory'=> null, 'StyleDirectory'=> null, 'ArticlePath'=> false, 'UploadPath'=> false, 'ImgAuthPath'=> false, 'ThumbPath'=> false, 'UploadDirectory'=> false, 'FileCacheDirectory'=> false, 'Logo'=> false, 'Logos'=> false, 'Favicon'=> '/favicon.ico', 'AppleTouchIcon'=> false, 'ReferrerPolicy'=> false, 'TmpDirectory'=> false, 'UploadBaseUrl'=> '', 'UploadStashScalerBaseUrl'=> false, 'ActionPaths'=>[], 'MainPageIsDomainRoot'=> false, 'EnableUploads'=> false, 'UploadStashMaxAge'=> 21600, 'EnableAsyncUploads'=> false, 'EnableAsyncUploadsByURL'=> false, 'EnableChunkedUploads'=> false, 'UploadMaintenance'=> false, 'IllegalFileChars'=> ':\\/\\\\', 'DeletedDirectory'=> false, 'ImgAuthDetails'=> false, 'ImgAuthUrlPathMap'=>[], 'LocalFileRepo'=>['class'=> 'MediaWiki\\FileRepo\\LocalRepo', 'name'=> 'local', 'directory'=> null, 'scriptDirUrl'=> null, 'favicon'=> null, 'url'=> null, 'hashLevels'=> null, 'thumbScriptUrl'=> null, 'transformVia404'=> null, 'deletedDir'=> null, 'deletedHashLevels'=> null, 'updateCompatibleMetadata'=> null, 'reserializeMetadata'=> null,], 'ForeignFileRepos'=>[], 'UseInstantCommons'=> false, 'UseSharedUploads'=> false, 'SharedUploadDirectory'=> null, 'SharedUploadPath'=> null, 'HashedSharedUploadDirectory'=> true, 'RepositoryBaseUrl'=> 'https:'FetchCommonsDescriptions'=> false, 'SharedUploadDBname'=> false, 'SharedUploadDBprefix'=> '', 'SharedUploadDBschema'=> null, 'CacheSharedUploads'=> true, 'ForeignUploadTargets'=>['local',], 'UploadDialog'=>['fields'=>['description'=> true, 'date'=> false, 'categories'=> false,], 'licensemessages'=>['local'=> 'generic-local', 'foreign'=> 'generic-foreign',], 'comment'=>['local'=> '', 'foreign'=> '',], 'format'=>['filepage'=> ' $DESCRIPTION', 'description'=> ' $TEXT', 'ownwork'=> '', 'license'=> '', 'uncategorized'=> '',],], 'FileBackends'=>[], 'LockManagers'=>[], 'DefaultLockManager'=> null, 'ShowEXIF'=> null, 'UpdateCompatibleMetadata'=> false, 'AllowCopyUploads'=> false, 'CopyUploadsDomains'=>[], 'CopyUploadsFromSpecialUpload'=> false, 'CopyUploadProxy'=> false, 'CopyUploadTimeout'=> false, 'CopyUploadAllowOnWikiDomainConfig'=> false, 'MaxUploadSize'=> 104857600, 'MinUploadChunkSize'=> 1024, 'UploadNavigationUrl'=> false, 'UploadMissingFileUrl'=> false, 'ThumbnailScriptPath'=> false, 'SharedThumbnailScriptPath'=> false, 'HashedUploadDirectory'=> true, 'CSPUploadEntryPoint'=> true, 'FileExtensions'=>['png', 'gif', 'jpg', 'jpeg', 'webp',], 'ProhibitedFileExtensions'=>['html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht', 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar', 'shtml', 'jhtml', 'pl', 'py', 'cgi', 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl', 'xml',], 'MimeTypeExclusions'=>['text/html', 'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript', 'application/x-php', 'text/x-php', 'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh', 'text/scriptlet', 'application/x-msdownload', 'application/x-msmetafile', 'application/java', 'application/xml', 'text/xml',], 'CheckFileExtensions'=> true, 'StrictFileExtensions'=> true, 'DisableUploadScriptChecks'=> false, 'UploadSizeWarning'=> false, 'TrustedMediaFormats'=>['BITMAP', 'AUDIO', 'VIDEO', 'image/svg+xml', 'application/pdf',], 'MediaHandlers'=>[], 'NativeImageLazyLoading'=> true, 'ParserTestMediaHandlers'=>['image/jpeg'=> 'MockBitmapHandler', 'image/png'=> 'MockBitmapHandler', 'image/gif'=> 'MockBitmapHandler', 'image/tiff'=> 'MockBitmapHandler', 'image/webp'=> 'MockBitmapHandler', 'image/x-ms-bmp'=> 'MockBitmapHandler', 'image/x-bmp'=> 'MockBitmapHandler', 'image/x-xcf'=> 'MockBitmapHandler', 'image/svg+xml'=> 'MockSvgHandler', 'image/vnd.djvu'=> 'MockDjVuHandler',], 'UseImageResize'=> true, 'UseImageMagick'=> false, 'ImageMagickConvertCommand'=> '/usr/bin/convert', 'MaxInterlacingAreas'=>[], 'SharpenParameter'=> '0x0.4', 'SharpenReductionThreshold'=> 0.85, 'ImageMagickTempDir'=> false, 'CustomConvertCommand'=> false, 'JpegTran'=> '/usr/bin/jpegtran', 'JpegPixelFormat'=> 'yuv420', 'JpegQuality'=> 80, 'Exiv2Command'=> '/usr/bin/exiv2', 'Exiftool'=> '/usr/bin/exiftool', 'SVGConverters'=>['ImageMagick'=> ' $path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output', 'inkscape'=> ' $path/inkscape -w $width -o $output $input', 'batik'=> 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input', 'rsvg'=> ' $path/rsvg-convert -w $width -h $height -l $lang -o $output $input', 'ImagickExt'=>['SvgHandler::rasterizeImagickExt',],], 'SVGConverter'=> 'ImageMagick', 'SVGConverterPath'=> '', 'SVGMaxSize'=> 5120, 'SVGMetadataCutoff'=> 5242880, 'SVGNativeRendering'=> true, 'SVGNativeRenderingSizeLimit'=> 51200, 'MediaInTargetLanguage'=> true, 'MaxImageArea'=> 12500000, 'MaxAnimatedGifArea'=> 12500000, 'MaxAnimatedWebPArea'=> 12500000, 'TiffThumbnailType'=>[], 'ThumbnailEpoch'=> '20030516000000', 'AttemptFailureEpoch'=> 1, 'IgnoreImageErrors'=> false, 'GenerateThumbnailOnParse'=> true, 'ShowArchiveThumbnails'=> true, 'EnableAutoRotation'=> null, 'Antivirus'=> null, 'AntivirusSetup'=>['clamav'=>['command'=> 'clamscan --no-summary ', 'codemap'=>[0=> 0, 1=> 1, 52=> -1, ' *'=> false,], 'messagepattern'=> '/.*?:(.*)/sim',],], 'AntivirusRequired'=> true, 'VerifyMimeType'=> true, 'MimeTypeFile'=> 'internal', 'MimeInfoFile'=> 'internal', 'MimeDetectorCommand'=> null, 'TrivialMimeDetection'=> false, 'XMLMimeTypes'=>['http:'svg'=> 'image/svg+xml', 'http:'http:'html'=> 'text/html',], 'ImageLimits'=>[[320, 240,], [640, 480,], [800, 600,], [1024, 768,], [1280, 1024,], [2560, 2048,],], 'ThumbLimits'=>[120, 150, 180, 200, 220, 250, 300, 400,], 'ThumbnailNamespaces'=>[6,], 'ThumbnailSteps'=> null, 'ThumbnailBuckets'=> null, 'ThumbnailMinimumBucketDistance'=> 50, 'UploadThumbnailRenderMap'=>[], 'UploadThumbnailRenderMethod'=> 'jobqueue', 'UploadThumbnailRenderHttpCustomHost'=> false, 'UploadThumbnailRenderHttpCustomDomain'=> false, 'UseTinyRGBForJPGThumbnails'=> false, 'GalleryOptions'=>[], 'ThumbUpright'=> 0.75, 'DirectoryMode'=> 511, 'ResponsiveImages'=> true, 'ImagePreconnect'=> false, 'TrackMediaRequestProvenance'=> false, 'DjvuUseBoxedCommand'=> false, 'DjvuDump'=> null, 'DjvuRenderer'=> null, 'DjvuTxt'=> null, 'DjvuPostProcessor'=> 'pnmtojpeg', 'DjvuOutputExtension'=> 'jpg', 'EmergencyContact'=> false, 'PasswordSender'=> false, 'NoReplyAddress'=> false, 'EnableEmail'=> true, 'EnableUserEmail'=> true, 'UserEmailUseReplyTo'=> true, 'PasswordReminderResendTime'=> 24, 'NewPasswordExpiry'=> 604800, 'UserEmailConfirmationTokenExpiry'=> 604800, 'PasswordExpirationDays'=> false, 'PasswordExpireGrace'=> 604800, 'SMTP'=> false, 'AdditionalMailParams'=> null, 'AllowHTMLEmail'=> false, 'EnotifFromEditor'=> false, 'EmailAuthentication'=> true, 'EmailConfirmationBanner'=> false, 'EnotifWatchlist'=> false, 'EnotifUserTalk'=> false, 'EnotifRevealEditorAddress'=> false, 'EnotifMinorEdits'=> true, 'EnotifUseRealName'=> false, 'UsersNotifiedOnAllChanges'=>[], 'DBname'=> 'my_wiki', 'DBmwschema'=> null, 'DBprefix'=> '', 'DBserver'=> 'localhost', 'DBport'=> 5432, 'DBuser'=> 'wikiuser', 'DBpassword'=> '', 'DBtype'=> 'mysql', 'DBssl'=> false, 'DBcompress'=> false, 'DBStrictWarnings'=> false, 'DBadminuser'=> null, 'DBadminpassword'=> null, 'SearchType'=> null, 'SearchTypeAlternatives'=> null, 'DBTableOptions'=> 'ENGINE=InnoDB, DEFAULT CHARSET=binary', 'SQLMode'=> '', 'SQLiteDataDir'=> '', 'SharedDB'=> null, 'SharedPrefix'=> false, 'SharedTables'=>['user', 'user_properties', 'user_autocreate_serial',], 'SharedSchema'=> false, 'DBservers'=> false, 'LBFactoryConf'=>['class'=> 'Wikimedia\\Rdbms\\LBFactorySimple',], 'DataCenterUpdateStickTTL'=> 10, 'DBerrorLog'=> false, 'DBerrorLogTZ'=> false, 'LocalDatabases'=>[], 'DatabaseReplicaLagWarning'=> 10, 'DatabaseReplicaLagCritical'=> 30, 'MaxExecutionTimeForExpensiveQueries'=> 0, 'VirtualDomainsMapping'=>[], 'RemoteVirtualDomainsMapping'=>[], 'FileSchemaMigrationStage'=> 3, 'ExternalLinksDomainGaps'=>[], 'ContentHandlers'=>['wikitext'=>['class'=> 'MediaWiki\\Content\\WikitextContentHandler', 'services'=>['TitleFactory', 'ParserFactory', 'GlobalIdGenerator', 'LanguageNameUtils', 'LinkRenderer', 'MagicWordFactory', 'ParsoidParserFactory',],], 'javascript'=>['class'=> 'MediaWiki\\Content\\JavaScriptContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'json'=>['class'=> 'MediaWiki\\Content\\JsonContentHandler', 'services'=>['ParsoidParserFactory', 'TitleFactory',],], 'css'=>['class'=> 'MediaWiki\\Content\\CssContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'vue'=>['class'=> 'MediaWiki\\Content\\VueContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'CodeHighlighter',],], 'text'=> 'MediaWiki\\Content\\TextContentHandler', 'unknown'=> 'MediaWiki\\Content\\FallbackContentHandler',], 'NamespaceContentModels'=>[], 'TextModelsToParse'=>['wikitext', 'javascript', 'css',], 'CompressRevisions'=> false, 'ExternalStores'=>[], 'ExternalServers'=>[], 'DefaultExternalStore'=> false, 'RevisionCacheExpiry'=> 604800, 'PageLanguageUseDB'=> false, 'DiffEngine'=> null, 'ExternalDiffEngine'=> false, 'Wikidiff2Options'=>[], 'RequestTimeLimit'=> null, 'TransactionalTimeLimit'=> 120, 'CriticalSectionTimeLimit'=> 180.0, 'MiserMode'=> false, 'DisableQueryPages'=> false, 'QueryCacheLimit'=> 1000, 'WantedPagesThreshold'=> 1, 'AllowSlowParserFunctions'=> false, 'AllowSchemaUpdates'=> true, 'MaxArticleSize'=> 2048, 'MemoryLimit'=> '50M', 'PoolCounterConf'=> null, 'PoolCountClientConf'=>['servers'=>['127.0.0.1',], 'timeout'=> 0.1,], 'MaxUserDBWriteDuration'=> false, 'MaxJobDBWriteDuration'=> false, 'LinkHolderBatchSize'=> 1000, 'MaximumMovedPages'=> 100, 'ForceDeferredUpdatesPreSend'=> false, 'MultiShardSiteStats'=> false, 'CacheDirectory'=> false, 'MainCacheType'=> 0, 'MessageCacheType'=> -1, 'ParserCacheType'=> -1, 'SessionCacheType'=> -1, 'AnonSessionCacheType'=> false, 'LanguageConverterCacheType'=> -1, 'ObjectCaches'=>[0=>['class'=> 'Wikimedia\\ObjectCache\\EmptyBagOStuff', 'reportDupes'=> false,], 1=>['class'=> 'MediaWiki\\ObjectCache\\SqlBagOStuff', 'loggroup'=> 'SQLBagOStuff',], 'memcached-php'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPhpBagOStuff', 'loggroup'=> 'memcached',], 'memcached-pecl'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPeclBagOStuff', 'loggroup'=> 'memcached',], 'hash'=>['class'=> 'Wikimedia\\ObjectCache\\HashBagOStuff', 'reportDupes'=> false,], 'apc'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,], 'apcu'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,],], 'WANObjectCache'=>[], 'MicroStashType'=> -1, 'MainStash'=> 1, 'ParsoidCacheConfig'=>['StashType'=> null, 'StashDuration'=> 86400,], 'ParsoidSelectiveUpdateSampleRate'=> 0, 'SplitParsoidParserCache'=> false, 'ParserCacheFilterConfig'=>['pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],], 'parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],],], 'ChronologyProtectorSecret'=> '', 'ParserCacheExpireTime'=> 86400, 'ParserCacheAsyncExpireTime'=> 60, 'ParserCacheAsyncRefreshJobs'=> true, 'OldRevisionParserCacheExpireTime'=> 3600, 'ObjectCacheSessionExpiry'=> 3600, 'SuspiciousIpExpiry'=> false, 'SessionPbkdf2Iterations'=> 10001, 'UseSessionCookieJwt'=> false, 'JwtSessionCookieIssuer'=> null, 'MemCachedServers'=>['127.0.0.1:11211',], 'MemCachedPersistent'=> false, 'MemCachedTimeout'=> 500000, 'UseLocalMessageCache'=> false, 'AdaptiveMessageCache'=> false, 'LocalisationCacheConf'=>['class'=> 'MediaWiki\\Language\\LocalisationCache', 'store'=> 'detect', 'storeClass'=> false, 'storeDirectory'=> false, 'storeServer'=>[], 'forceRecache'=> false, 'manualRecache'=> false,], 'CachePages'=> true, 'CacheEpoch'=> '20030516000000', 'GitInfoCacheDirectory'=> false, 'UseFileCache'=> false, 'FileCacheDepth'=> 2, 'RenderHashAppend'=> '', 'EnableSidebarCache'=> false, 'SidebarCacheExpiry'=> 86400, 'UseGzip'=> false, 'InvalidateCacheOnLocalSettingsChange'=> true, 'ExtensionInfoMTime'=> false, 'EnableRemoteBagOStuffTests'=> false, 'UseCdn'=> false, 'VaryOnXFP'=> false, 'InternalServer'=> false, 'CdnMaxAge'=> 18000, 'CdnMaxageLagged'=> 30, 'CdnMaxageStale'=> 10, 'CdnReboundPurgeDelay'=> 0, 'CdnMaxageSubstitute'=> 60, 'CdnServers'=>[], 'CdnServersNoPurge'=>[], 'HTCPRouting'=>[], 'HTCPMulticastTTL'=> 1, 'UsePrivateIPs'=> false, 'CdnMatchParameterOrder'=> true, 'LanguageCode'=> 'en', 'GrammarForms'=>[], 'InterwikiMagic'=> true, 'HideInterlanguageLinks'=> false, 'ExtraInterlanguageLinkPrefixes'=>[], 'InterlanguageLinkCodeMap'=>[], 'ExtraLanguageNames'=>[], 'ExtraLanguageCodes'=>['bh'=> 'bho', 'no'=> 'nb', 'simple'=> 'en',], 'DummyLanguageCodes'=>[], 'AllUnicodeFixes'=> false, 'LegacyEncoding'=> false, 'AmericanDates'=> false, 'TranslateNumerals'=> true, 'UseDatabaseMessages'=> true, 'MaxMsgCacheEntrySize'=> 10000, 'DisableLangConversion'=> false, 'DisableTitleConversion'=> false, 'DefaultLanguageVariant'=> false, 'UsePigLatinVariant'=> false, 'DisabledVariants'=>[], 'VariantArticlePath'=> false, 'UseXssLanguage'=> false, 'LoginLanguageSelector'=> false, 'ForceUIMsgAsContentMsg'=>[], 'RawHtmlMessages'=>[], 'Localtimezone'=> null, 'LocalTZoffset'=> null, 'OverrideUcfirstCharacters'=>[], 'MimeType'=> 'text/html', 'Html5Version'=> null, 'EditSubmitButtonLabelPublish'=> false, 'XhtmlNamespaces'=>[], 'SiteNotice'=> '', 'BrowserFormatDetection'=> 'telephone=no', 'SkinMetaTags'=>[], 'DefaultSkin'=> 'vector-2022', 'FallbackSkin'=> 'fallback', 'SkipSkins'=>[], 'DisableOutputCompression'=> false, 'FragmentMode'=>['html5', 'legacy',], 'ExternalInterwikiFragmentMode'=> 'legacy', 'FooterIcons'=>['copyright'=>['copyright'=>[],], 'poweredby'=>['mediawiki'=>['src'=> null, 'url'=> 'https:'alt'=> 'Powered by MediaWiki', 'lang'=> 'en',],],], 'EnableSectionShare'=> false, 'PageShareSkinsEnabled'=>[], 'UseCombinedLoginLink'=> false, 'Edititis'=> false, 'Send404Code'=> true, 'ShowRollbackEditCount'=> 10, 'EnableCanonicalServerLink'=> false, 'InterwikiLogoOverride'=>[], 'ResourceModules'=>[], 'ResourceModuleSkinStyles'=>[], 'ResourceLoaderSources'=>[], 'ResourceBasePath'=> null, 'ResourceLoaderMaxage'=>[], 'ResourceLoaderDebug'=> false, 'ResourceLoaderMaxQueryLength'=> false, 'ResourceLoaderValidateJS'=> true, 'ResourceLoaderEnableJSProfiler'=> false, 'ResourceLoaderStorageEnabled'=> true, 'ResourceLoaderStorageVersion'=> 1, 'ResourceLoaderEnableSourceMapLinks'=> true, 'AllowSiteCSSOnRestrictedPages'=> false, 'VueDevelopmentMode'=> false, 'CodexDevelopmentDir'=> null, 'MetaNamespace'=> false, 'MetaNamespaceTalk'=> false, 'CanonicalNamespaceNames'=>[-2=> 'Media', -1=> 'Special', 0=> '', 1=> 'Talk', 2=> 'User', 3=> 'User_talk', 4=> 'Project', 5=> 'Project_talk', 6=> 'File', 7=> 'File_talk', 8=> 'MediaWiki', 9=> 'MediaWiki_talk', 10=> 'Template', 11=> 'Template_talk', 12=> 'Help', 13=> 'Help_talk', 14=> 'Category', 15=> 'Category_talk',], 'ExtraNamespaces'=>[], 'ExtraGenderNamespaces'=>[], 'NamespaceAliases'=>[], 'LegalTitleChars'=> ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+', 'CapitalLinks' => true, 'CapitalLinkOverrides' => [ ], 'NamespacesWithSubpages' => [ 1 => true, 2 => true, 3 => true, 4 => true, 5 => true, 7 => true, 8 => true, 9 => true, 10 => true, 11 => true, 12 => true, 13 => true, 15 => true, ], 'NamespacesWithoutAutoSummaries' => [ ], 'ContentNamespaces' => [ 0, ], 'ShortPagesNamespaceExclusions' => [ ], 'ExtraSignatureNamespaces' => [ ], 'InvalidRedirectTargets' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog', ], 'DisableHardRedirects' => false, 'FixDoubleRedirects' => false, 'LocalInterwikis' => [ ], 'InterwikiExpiry' => 10800, 'InterwikiCache' => false, 'InterwikiScopes' => 3, 'InterwikiFallbackSite' => 'wiki', 'RedirectSources' => false, 'SiteTypes' => [ 'mediawiki' => 'MediaWiki\\Site\\MediaWikiSite', ], 'MaxTocLevel' => 999, 'MaxPPNodeCount' => 1000000, 'MaxTemplateDepth' => 100, 'MaxPPExpandDepth' => 100, 'UrlProtocols' => [ 'bitcoin:', 'ftp: 'ftps: 'geo:', 'git: 'gopher: 'http: 'https: 'irc: 'ircs: 'magnet:', 'mailto:', 'matrix:', 'mms: 'news:', 'nntp: 'redis: 'sftp: 'sip:', 'sips:', 'sms:', 'ssh: 'svn: 'tel:', 'telnet: 'urn:', 'wikipedia: 'worldwind: 'xmpp:', ' ], 'CleanSignatures' => true, 'AllowExternalImages' => false, 'AllowExternalImagesFrom' => '', 'EnableImageWhitelist' => false, 'TidyConfig' => [ ], 'ParsoidSettings' => [ 'useSelser' => true, ], 'ParsoidExperimentalParserFunctionOutput' => false, 'RawHtml' => false, 'ExternalLinkTarget' => false, 'NoFollowLinks' => true, 'NoFollowNsExceptions' => [ ], 'NoFollowDomainExceptions' => [ 'mediawiki.org', ], 'RegisterInternalExternals' => false, 'ExternalLinksIgnoreDomains' => [ ], 'AllowDisplayTitle' => true, 'RestrictDisplayTitle' => true, 'ExpensiveParserFunctionLimit' => 100, 'PreprocessorCacheThreshold' => 1000, 'EnableScaryTranscluding' => false, 'TranscludeCacheExpiry' => 3600, 'EnableMagicLinks' => [ 'ISBN' => false, 'PMID' => false, 'RFC' => false, ], 'ParserEnableUserLanguage' => false, 'ArticleCountMethod' => 'link', 'ActiveUserDays' => 30, 'LearnerEdits' => 10, 'LearnerMemberSince' => 4, 'ExperiencedUserEdits' => 500, 'ExperiencedUserMemberSince' => 30, 'ManualRevertSearchRadius' => 15, 'RevertedTagMaxDepth' => 15, 'CentralIdLookupProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\CentralId\\LocalIdLookup', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', 'HideUserUtils', ], ], ], 'CentralIdLookupProvider' => 'local', 'UserRegistrationProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\Registration\\LocalUserRegistrationProvider', 'services' => [ 'ConnectionProvider', ], ], ], 'PasswordPolicy' => [ 'policies' => [ 'bureaucrat' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'sysop' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'interface-admin' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'bot' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'default' => [ 'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true, ], 'PasswordCannotBeSubstringInUsername' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true, ], 'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], ], ], 'checks' => [ 'MinimalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimalPasswordLength', ], 'MinimumPasswordLengthToLogin' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimumPasswordLengthToLogin', ], 'PasswordCannotBeSubstringInUsername' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotBeSubstringInUsername', ], 'PasswordCannotMatchDefaults' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotMatchDefaults', ], 'MaximalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMaximalPasswordLength', ], 'PasswordNotInCommonList' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordNotInCommonList', ], ], ], 'AuthManagerConfig' => null, 'AuthManagerAutoConfig' => [ 'preauth' => [ 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider', 'services' => [ 'ConnectionProvider', 'UserFactory', ], 'sort' => 0, ], ], 'primaryauth' => [ 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', 'UserOptionsLookup', ], 'args' => [ [ 'authoritative' => false, ], ], 'sort' => 0, ], 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'args' => [ [ 'authoritative' => true, ], ], 'sort' => 100, ], ], 'secondaryauth' => [ 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider', 'sort' => 100, ], 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'sort' => 200, ], ], ], 'RememberMe' => 'choose', 'ReauthenticateTime' => [ 'default' => 3600, ], 'ChangeCredentialsBlacklist' => [ 'MediaWiki\\Auth\\TemporaryPasswordAuthenticationRequest', ], 'RemoveCredentialsBlacklist' => [ 'MediaWiki\\Auth\\PasswordAuthenticationRequest', ], 'InvalidPasswordReset' => true, 'PasswordDefault' => 'pbkdf2', 'PasswordConfig' => [ 'A' => [ 'class' => 'MediaWiki\\Password\\MWOldPassword', ], 'B' => [ 'class' => 'MediaWiki\\Password\\MWSaltedPassword', ], 'pbkdf2-legacyA' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'A', 'pbkdf2', ], ], 'pbkdf2-legacyB' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'B', 'pbkdf2', ], ], 'bcrypt' => [ 'class' => 'MediaWiki\\Password\\BcryptPassword', 'cost' => 9, ], 'pbkdf2' => [ 'class' => 'MediaWiki\\Password\\Pbkdf2PasswordUsingOpenSSL', 'algo' => 'sha512', 'cost' => '30000', 'length' => '64', ], 'argon2' => [ 'class' => 'MediaWiki\\Password\\Argon2Password', 'algo' => 'auto', ], ], 'PasswordResetRoutes' => [ 'username' => true, 'email' => true, ], 'MaxSigChars' => 255, 'SignatureValidation' => 'warning', 'SignatureAllowedLintErrors' => [ 'obsolete-tag', ], 'MaxNameChars' => 255, 'ReservedUsernames' => [ 'MediaWiki default', 'Conversion script', 'Maintenance script', 'Template namespace initialisation script', 'ScriptImporter', 'Delete page script', 'Move page script', 'Command line script', 'Unknown user', 'msg:double-redirect-fixer', 'msg:usermessage-editor', 'msg:proxyblocker', 'msg:sorbs', 'msg:spambot_username', 'msg:autochange-username', ], 'DefaultUserOptions' => [ 'ccmeonemails' => 0, 'date' => 'default', 'diffonly' => 0, 'diff-type' => 'table', 'disablemail' => 0, 'editfont' => 'monospace', 'editondblclick' => 0, 'editrecovery' => 0, 'editsectiononrightclick' => 0, 'email-allow-new-users' => 1, 'enotifminoredits' => 0, 'enotifrevealaddr' => 0, 'enotifusertalkpages' => 1, 'enotifwatchlistpages' => 1, 'extendwatchlist' => 1, 'fancysig' => 0, 'forceeditsummary' => 0, 'forcesafemode' => 0, 'gender' => 'unknown', 'hidecategorization' => 1, 'hideminor' => 0, 'hidepatrolled' => 0, 'imagesize' => 2, 'minordefault' => 0, 'newpageshidepatrolled' => 0, 'nickname' => '', 'norollbackdiff' => 0, 'prefershttps' => 1, 'previewonfirst' => 0, 'previewontop' => 1, 'pst-cssjs' => 1, 'rcdays' => 7, 'rcenhancedfilters-disable' => 0, 'rclimit' => 50, 'requireemail' => 0, 'search-match-redirect' => true, 'search-special-page' => 'Search', 'search-thumbnail-extra-namespaces' => true, 'searchlimit' => 20, 'showhiddencats' => 0, 'shownumberswatching' => 1, 'showrollbackconfirmation' => 0, 'skin' => false, 'skin-responsive' => 1, 'thumbsize' => 5, 'underline' => 2, 'useeditwarning' => 1, 'uselivepreview' => 0, 'usenewrc' => 1, 'watchcreations' => 1, 'watchcreations-expiry' => 'infinite', 'watchdefault' => 1, 'watchdefault-expiry' => 'infinite', 'watchdeletion' => 0, 'watchlistdays' => 7, 'watchlisthideanons' => 0, 'watchlisthidebots' => 0, 'watchlisthidecategorization' => 1, 'watchlisthideliu' => 0, 'watchlisthideminor' => 0, 'watchlisthideown' => 0, 'watchlisthidepatrolled' => 0, 'watchlistreloadautomatically' => 0, 'watchlistunwatchlinks' => 0, 'watchmoves' => 0, 'watchrollback' => 0, 'watchuploads' => 1, 'watchrollback-expiry' => 'infinite', 'watchstar-expiry' => 'infinite', 'wlenhancedfilters-disable' => 0, 'wllimit' => 250, ], 'ConditionalUserOptions' => [ ], 'HiddenPrefs' => [ ], 'UserJsPrefLimit' => 100, 'InvalidUsernameCharacters' => '@:>=', 'UserrightsInterwikiDelimiter' => '@', 'SecureLogin' => false, 'AuthenticationTokenVersion' => null, 'SessionProviders' => [ 'MediaWiki\\Session\\CookieSessionProvider' => [ 'class' => 'MediaWiki\\Session\\CookieSessionProvider', 'args' => [ [ 'priority' => 30, ], ], 'services' => [ 'JwtCodec', 'UrlUtils', ], ], 'MediaWiki\\Session\\BotPasswordSessionProvider' => [ 'class' => 'MediaWiki\\Session\\BotPasswordSessionProvider', 'args' => [ [ 'priority' => 75, ], ], 'services' => [ 'GrantsInfo', ], ], ], 'AutoCreateTempUser' => [ 'known' => false, 'enabled' => false, 'actions' => [ 'edit', ], 'genPattern' => '~$1', 'matchPattern' => null, 'reservedPattern' => '~$1', 'serialProvider' => [ 'type' => 'local', 'useYear' => true, ], 'serialMapping' => [ 'type' => 'readable-numeric', ], 'expireAfterDays' => 90, 'notifyBeforeExpirationDays' => 10, ], 'AutoblockExemptions' => [ ], 'AutoblockExpiry' => 86400, 'BlockAllowsUTEdit' => true, 'BlockCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 19, ], 'BlockDisablesLogin' => false, 'EnableMultiBlocks' => false, 'WhitelistRead' => false, 'WhitelistReadRegexp' => false, 'EmailConfirmToEdit' => false, 'HideIdentifiableRedirects' => true, 'GroupPermissions' => [ '*' => [ 'createaccount' => true, 'autocreateaccount' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'viewmyprivateinfo' => true, 'editmyprivateinfo' => true, 'editmyoptions' => true, ], 'user' => [ 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'movefile' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'minoredit' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, 'editmyuserjsredirect' => true, 'sendemail' => true, 'applychangetags' => true, 'changetags' => true, 'viewmywatchlist' => true, 'editmywatchlist' => true, 'createwithcontentmodel' => true, 'logout' => true, ], 'autoconfirmed' => [ 'autoconfirmed' => true, 'editsemiprotected' => true, ], 'bot' => [ 'bot' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'nominornewtalk' => true, 'autopatrol' => true, 'suppressredirect' => true, 'apihighlimits' => true, ], 'sysop' => [ 'block' => true, 'createaccount' => true, 'createpreviouslyrenamedaccount' => true, 'delete' => true, 'bigdelete' => true, 'deletedhistory' => true, 'deletedtext' => true, 'undelete' => true, 'editcontentmodel' => true, 'editinterface' => true, 'editsitejson' => true, 'edituserjson' => true, 'import' => true, 'importupload' => true, 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'patrol' => true, 'autopatrol' => true, 'protect' => true, 'editprotected' => true, 'rollback' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'unwatchedpages' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'blockemail' => true, 'markbotedits' => true, 'apihighlimits' => true, 'browsearchive' => true, 'noratelimit' => true, 'movefile' => true, 'unblockself' => true, 'suppressredirect' => true, 'mergehistory' => true, 'managechangetags' => true, 'deletechangetags' => true, ], 'interface-admin' => [ 'editinterface' => true, 'editsitecss' => true, 'editsitejson' => true, 'editsitejs' => true, 'editusercss' => true, 'edituserjson' => true, 'edituserjs' => true, ], 'bureaucrat' => [ 'userrights' => true, 'noratelimit' => true, 'renameuser' => true, ], 'suppress' => [ 'hideuser' => true, 'suppressrevision' => true, 'viewsuppressed' => true, 'suppressionlog' => true, 'deleterevision' => true, 'deletelogentry' => true, ], ], 'PrivilegedGroups' => [ 'bureaucrat', 'interface-admin', 'suppress', 'sysop', ], 'RevokePermissions' => [ ], 'GroupInheritsPermissions' => [ ], 'ImplicitGroups' => [ '*', 'user', 'autoconfirmed', ], 'GroupsAddToSelf' => [ ], 'GroupsRemoveFromSelf' => [ ], 'RestrictedGroups' => [ ], 'UserRequirementsPrivateConditions' => [ ], 'RestrictionTypes' => [ 'create', 'edit', 'move', 'upload', ], 'RestrictionLevels' => [ '', 'autoconfirmed', 'sysop', ], 'CascadingRestrictionLevels' => [ 'sysop', ], 'SemiprotectedRestrictionLevels' => [ 'autoconfirmed', ], 'NamespaceProtection' => [ ], 'RestrictUserPageEditing' => false, 'NonincludableNamespaces' => [ ], 'AutoConfirmAge' => 0, 'AutoConfirmCount' => 0, 'Autopromote' => [ 'autoconfirmed' => [ '&', [ 1, null, ], [ 2, null, ], ], ], 'AutopromoteOnce' => [ 'onEdit' => [ ], ], 'AutopromoteOnceLogInRC' => true, 'AutopromoteOnceRCExcludedGroups' => [ ], 'AddGroups' => [ ], 'RemoveGroups' => [ ], 'AvailableRights' => [ ], 'ImplicitRights' => [ ], 'DeleteRevisionsLimit' => 0, 'DeleteRevisionsBatchSize' => 1000, 'HideUserContribLimit' => 1000, 'AccountCreationThrottle' => [ [ 'count' => 0, 'seconds' => 86400, ], ], 'TempAccountCreationThrottle' => [ [ 'count' => 1, 'seconds' => 600, ], [ 'count' => 6, 'seconds' => 86400, ], ], 'TempAccountNameAcquisitionThrottle' => [ [ 'count' => 60, 'seconds' => 86400, ], ], 'SpamRegex' => [ ], 'SummarySpamRegex' => [ ], 'EnableDnsBlacklist' => false, 'DnsBlacklistUrls' => [ ], 'ProxyList' => [ ], 'ProxyWhitelist' => [ ], 'SoftBlockRanges' => [ ], 'ApplyIpBlocksToXff' => false, 'RateLimits' => [ 'edit' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], 'user' => [ 90, 60, ], ], 'move' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], 'upload' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'rollback' => [ 'user' => [ 10, 60, ], 'newbie' => [ 5, 120, ], ], 'mailpassword' => [ 'ip' => [ 5, 3600, ], ], 'sendemail' => [ 'ip' => [ 5, 86400, ], 'newbie' => [ 5, 86400, ], 'user' => [ 20, 86400, ], ], 'changeemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'confirmemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'purge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'linkpurge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'renderfile' => [ 'ip' => [ 700, 30, ], 'user' => [ 700, 30, ], ], 'renderfile-nonstandard' => [ 'ip' => [ 70, 30, ], 'user' => [ 70, 30, ], ], 'stashedit' => [ 'ip' => [ 30, 60, ], 'newbie' => [ 30, 60, ], ], 'stashbasehtml' => [ 'ip' => [ 5, 60, ], 'newbie' => [ 5, 60, ], ], 'changetags' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'editcontentmodel' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], ], 'RateLimitsExcludedIPs' => [ ], 'PutIPinRC' => true, 'QueryPageDefaultLimit' => 50, 'ExternalQuerySources' => [ ], 'PasswordAttemptThrottle' => [ [ 'count' => 5, 'seconds' => 300, ], [ 'count' => 150, 'seconds' => 172800, ], ], 'GrantPermissions' => [ 'basic' => [ 'autocreateaccount' => true, 'autoconfirmed' => true, 'autopatrol' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'nominornewtalk' => true, 'patrolmarks' => true, 'read' => true, 'unwatchedpages' => true, ], 'highvolume' => [ 'bot' => true, 'apihighlimits' => true, 'noratelimit' => true, 'markbotedits' => true, ], 'import' => [ 'import' => true, 'importupload' => true, ], 'editpage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'pagelang' => true, ], 'editprotected' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, ], 'editmycssjs' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, ], 'editmyoptions' => [ 'editmyoptions' => true, 'editmyuserjson' => true, ], 'editinterface' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, ], 'editsiteconfig' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, 'editusercss' => true, 'edituserjs' => true, 'editsitecss' => true, 'editsitejs' => true, ], 'createeditmovepage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'createpage' => true, 'createtalk' => true, 'delete-redirect' => true, 'move' => true, 'move-rootuserpages' => true, 'move-subpages' => true, 'move-categorypages' => true, 'suppressredirect' => true, ], 'uploadfile' => [ 'upload' => true, 'reupload-own' => true, ], 'uploadeditmovefile' => [ 'upload' => true, 'reupload-own' => true, 'reupload' => true, 'reupload-shared' => true, 'upload_by_url' => true, 'movefile' => true, 'suppressredirect' => true, ], 'patrol' => [ 'patrol' => true, ], 'rollback' => [ 'rollback' => true, ], 'blockusers' => [ 'block' => true, 'blockemail' => true, ], 'viewdeleted' => [ 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, ], 'viewrestrictedlogs' => [ 'suppressionlog' => true, ], 'delete' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, 'delete' => true, 'bigdelete' => true, 'deletelogentry' => true, 'deleterevision' => true, 'undelete' => true, ], 'oversight' => [ 'suppressrevision' => true, 'viewsuppressed' => true, ], 'protect' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, 'protect' => true, ], 'viewmywatchlist' => [ 'viewmywatchlist' => true, ], 'editmywatchlist' => [ 'editmywatchlist' => true, ], 'sendemail' => [ 'sendemail' => true, ], 'createaccount' => [ 'createaccount' => true, ], 'privateinfo' => [ 'viewmyprivateinfo' => true, ], 'mergehistory' => [ 'mergehistory' => true, ], 'managesessions' => [ 'logout' => true, ], ], 'GrantPermissionGroups' => [ 'basic' => 'hidden', 'editpage' => 'page-interaction', 'createeditmovepage' => 'page-interaction', 'editprotected' => 'page-interaction', 'patrol' => 'page-interaction', 'uploadfile' => 'file-interaction', 'uploadeditmovefile' => 'file-interaction', 'sendemail' => 'email', 'viewmywatchlist' => 'watchlist-interaction', 'editmywatchlist' => 'watchlist-interaction', 'editmycssjs' => 'customization', 'editmyoptions' => 'customization', 'editinterface' => 'administration', 'editsiteconfig' => 'administration', 'rollback' => 'administration', 'blockusers' => 'administration', 'delete' => 'administration', 'viewdeleted' => 'administration', 'viewrestrictedlogs' => 'administration', 'protect' => 'administration', 'oversight' => 'administration', 'createaccount' => 'administration', 'mergehistory' => 'administration', 'import' => 'administration', 'highvolume' => 'high-volume', 'privateinfo' => 'private-information', 'managesessions' => 'private-information', ], 'GrantRiskGroups' => [ 'basic' => 'low', 'editpage' => 'low', 'createeditmovepage' => 'low', 'editprotected' => 'vandalism', 'patrol' => 'low', 'uploadfile' => 'low', 'uploadeditmovefile' => 'low', 'sendemail' => 'security', 'viewmywatchlist' => 'low', 'editmywatchlist' => 'low', 'editmycssjs' => 'security', 'editmyoptions' => 'security', 'editinterface' => 'vandalism', 'editsiteconfig' => 'security', 'rollback' => 'low', 'blockusers' => 'vandalism', 'delete' => 'vandalism', 'viewdeleted' => 'vandalism', 'viewrestrictedlogs' => 'security', 'protect' => 'vandalism', 'oversight' => 'security', 'createaccount' => 'low', 'mergehistory' => 'vandalism', 'import' => 'security', 'highvolume' => 'low', 'privateinfo' => 'low', 'managesessions' => 'low', ], 'EnableBotPasswords' => true, 'BotPasswordsCluster' => false, 'BotPasswordsDatabase' => false, 'BotPasswordsLimit' => 100, 'SecretKey' => false, 'JwtPrivateKey' => false, 'JwtPublicKey' => false, 'AllowUserJs' => false, 'ReauthenticateForActions' => [ 'edituserjs' => 'edituserjscss', 'editusercss' => 'edituserjscss', 'editsitejs' => 'editsitejscss', 'editsitecss' => 'editsitejscss', ], 'AllowUserCss' => false, 'AllowUserCssPrefs' => true, 'UseSiteJs' => true, 'UseSiteCss' => true, 'BreakFrames' => false, 'EditPageFrameOptions' => 'DENY', 'ApiFrameOptions' => 'DENY', 'CSPHeader' => false, 'CSPReportOnlyHeader' => false, 'CSPUseReportURIDirective' => false, 'CSPFalsePositiveUrls' => [ 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'chrome-extension' => true, ], 'AllowCrossOrigin' => false, 'RestAllowCrossOriginCookieAuth' => false, 'SessionSecret' => false, 'CookieExpiration' => 2592000, 'ExtendedLoginCookieExpiration' => 15552000, 'SessionCookieJwtExpiration' => 14400, 'CookieDomain' => '', 'CookiePath' => '/', 'CookieSecure' => 'detect', 'CookiePrefix' => false, 'CookieHttpOnly' => true, 'CookieSameSite' => null, 'CacheVaryCookies' => [ ], 'SessionName' => false, 'CookieSetOnAutoblock' => true, 'CookieSetOnIpBlock' => true, 'DeviceBoundSessions' => false, 'DeviceBoundSessionsReportOnly' => true, 'DeviceBoundSessionCookieName' => '__Host-dbsc', 'DeviceBoundSessionCredentialTTL' => 600, 'DeviceBoundSessionChallengeTTL' => 900, 'DeviceBoundSessionBindingTTL' => 2592000, 'DeviceBoundSessionScopeExcludes' => [ ], 'DebugLogFile' => '', 'DebugLogPrefix' => '', 'DebugRedirects' => false, 'DebugRawPage' => false, 'DebugComments' => false, 'DebugDumpSql' => false, 'TrxProfilerLimits' => [ 'GET' => [ 'masterConns' => 0, 'writes' => 0, 'readQueryTime' => 5, 'readQueryRows' => 10000, ], 'POST' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 100000, 'maxAffected' => 1000, ], 'POST-nonwrite' => [ 'writes' => 0, 'readQueryTime' => 5, 'readQueryRows' => 10000, ], 'PostSend-GET' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 10000, 'maxAffected' => 1000, 'masterConns' => 0, 'writes' => 0, ], 'PostSend-POST' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 100000, 'maxAffected' => 1000, ], 'JobRunner' => [ 'readQueryTime' => 30, 'writeQueryTime' => 5, 'readQueryRows' => 100000, 'maxAffected' => 500, ], 'Maintenance' => [ 'writeQueryTime' => 5, 'maxAffected' => 1000, ], ], 'DebugLogGroups' => [ ], 'MWLoggerDefaultSpi' => [ 'class' => 'MediaWiki\\Logger\\LegacySpi', ], 'ShowDebug' => false, 'SpecialVersionShowHooks' => false, 'ShowExceptionDetails' => false, 'LogExceptionBacktrace' => true, 'PropagateErrors' => true, 'ShowHostnames' => false, 'OverrideHostname' => false, 'DevelopmentWarnings' => false, 'DeprecationReleaseLimit' => false, 'Profiler' => [ ], 'StatsTarget' => null, 'StatsFormat' => null, 'StatsPrefix' => 'mediawiki', 'OpenTelemetryConfig' => null, 'PageInfoTransclusionLimit' => 50, 'EnableJavaScriptTest' => false, 'DebugToolbar' => false, 'ApiClientErrorSampleRate' => 1.0, 'DisableTextSearch' => false, 'AdvancedSearchHighlighting' => false, 'SearchHighlightBoundaries' => '[\\p{Z}\\p{P}\\p{C}]', 'OpenSearchTemplates' => [ 'application/x-suggestions+json' => false, 'application/x-suggestions+xml' => false, ], 'OpenSearchDefaultLimit' => 10, 'OpenSearchDescriptionLength' => 100, 'SearchSuggestCacheExpiry' => 1200, 'DisableSearchUpdate' => false, 'NamespacesToBeSearchedDefault' => [ true, ], 'DisableInternalSearch' => false, 'SearchForwardUrl' => null, 'SitemapNamespaces' => false, 'SitemapNamespacesPriorities' => false, 'SitemapApiConfig' => [ ], 'SpecialSearchFormOptions' => [ ], 'SearchMatchRedirectPreference' => false, 'SearchRunSuggestedQuery' => true, 'Diff3' => '/usr/bin/diff3', 'Diff' => '/usr/bin/diff', 'PreviewOnOpenNamespaces' => [ 14 => true, ], 'UniversalEditButton' => true, 'UseAutomaticEditSummaries' => true, 'CommandLineDarkBg' => false, 'ReadOnly' => null, 'ReadOnlyWatchedItemStore' => false, 'ReadOnlyFile' => false, 'UpgradeKey' => false, 'GitBin' => '/usr/bin/git', 'GitRepositoryViewers' => [ 'https: 'ssh: 'https: 'git@github\\.com:(.*?)(\\.git)?' => 'https: ], 'InstallerInitialPages' => [ [ 'titlemsg' => 'mainpage', 'text' => '{{subst:int:mainpagetext}}{{subst:int:mainpagedocfooter}}', ], ], 'RCMaxAge' => 7776000, 'WatchersMaxAge' => 15552000, 'UnwatchedPageSecret' => 1, 'RCFilterByAge' => false, 'RCLinkLimits' => [ 50, 100, 250, 500, ], 'RCLinkDays' => [ 1, 3, 7, 14, 30, ], 'RCFeeds' => [ ], 'RCWatchCategoryMembership' => false, 'UseRCPatrol' => true, 'StructuredChangeFiltersLiveUpdatePollingRate' => 3, 'UseNPPatrol' => true, 'UseFilePatrol' => true, 'Feed' => true, 'FeedLimit' => 50, 'FeedCacheTimeout' => 60, 'FeedDiffCutoff' => 32768, 'OverrideSiteFeed' => [ ], 'FeedClasses' => [ 'rss' => 'MediaWiki\\Feed\\RSSFeed', 'atom' => 'MediaWiki\\Feed\\AtomFeed', ], 'AdvertisedFeedTypes' => [ 'atom', ], 'RCShowWatchingUsers' => false, 'RCShowChangedSize' => true, 'RCChangedSizeThreshold' => 500, 'ShowUpdatedMarker' => true, 'DisableAnonTalk' => false, 'UseTagFilter' => true, 'SoftwareTags' => [ 'mw-contentmodelchange' => true, 'mw-new-redirect' => true, 'mw-removed-redirect' => true, 'mw-changed-redirect-target' => true, 'mw-blank' => true, 'mw-replace' => true, 'mw-recreated' => true, 'mw-rollback' => true, 'mw-undo' => true, 'mw-manual-revert' => true, 'mw-reverted' => true, 'mw-server-side-upload' => true, 'mw-ipblock-appeal' => true, 'mw-edited-other-users-js' => true, 'mw-edited-other-users-css' => true, ], 'RestrictedTagViewRights' => [ ], 'UnwatchedPageThreshold' => false, 'RecentChangesFlags' => [ 'newpage' => [ 'letter' => 'newpageletter', 'title' => 'recentchanges-label-newpage', 'legend' => 'recentchanges-legend-newpage', 'grouping' => 'any', ], 'minor' => [ 'letter' => 'minoreditletter', 'title' => 'recentchanges-label-minor', 'legend' => 'recentchanges-legend-minor', 'class' => 'minoredit', 'grouping' => 'all', ], 'bot' => [ 'letter' => 'boteditletter', 'title' => 'recentchanges-label-bot', 'legend' => 'recentchanges-legend-bot', 'class' => 'botedit', 'grouping' => 'all', ], 'unpatrolled' => [ 'letter' => 'unpatrolledletter', 'title' => 'recentchanges-label-unpatrolled', 'legend' => 'recentchanges-legend-unpatrolled', 'grouping' => 'any', ], ], 'WatchlistExpiry' => false, 'EnableWatchstarPopover' => false, 'EnableWatchlistLabels' => false, 'WatchlistLabelsMaxPerUser' => 100, 'WatchlistPurgeRate' => 0.1, 'WatchlistExpiryMaxDuration' => '1 year', 'EnableChangesListQueryPartitioning' => false, 'RightsPage' => null, 'RightsUrl' => null, 'RightsText' => null, 'RightsIcon' => null, 'UseCopyrightUpload' => false, 'MaxCredits' => 0, 'ShowCreditsIfMax' => true, 'ImportSources' => [ ], 'ImportTargetNamespace' => null, 'ExportAllowHistory' => true, 'ExportMaxHistory' => 0, 'ExportAllowListContributors' => false, 'ExportMaxLinkDepth' => 0, 'ExportFromNamespaces' => false, 'ExportAllowAll' => false, 'ExportPagelistLimit' => 5000, 'XmlDumpSchemaVersion' => '0.11', 'WikiFarmSettingsDirectory' => null, 'WikiFarmSettingsExtension' => 'yaml', 'ExtensionFunctions' => [ ], 'ExtensionMessagesFiles' => [ ], 'MessagesDirs' => [ ], 'TranslationAliasesDirs' => [ ], 'ExtensionEntryPointListFiles' => [ ], 'EnableParserLimitReporting' => true, 'ValidSkinNames' => [ ], 'SpecialPages' => [ ], 'ExtensionCredits' => [ ], 'Hooks' => [ ], 'ServiceWiringFiles' => [ ], 'JobClasses' => [ 'deletePage' => 'MediaWiki\\Page\\DeletePageJob', 'refreshLinks' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'deleteLinks' => 'MediaWiki\\Page\\DeleteLinksJob', 'htmlCacheUpdate' => 'MediaWiki\\JobQueue\\Jobs\\HTMLCacheUpdateJob', 'sendMail' => [ 'class' => 'MediaWiki\\Mail\\EmaillingJob', 'services' => [ 'Emailer', ], ], 'enotifNotify' => [ 'class' => 'MediaWiki\\RecentChanges\\RecentChangeNotifyJob', 'services' => [ 'RecentChangeLookup', ], ], 'fixDoubleRedirect' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\DoubleRedirectJob', 'services' => [ 'RevisionLookup', 'MagicWordFactory', 'WikiPageFactory', ], 'needsPage' => true, ], 'AssembleUploadChunks' => 'MediaWiki\\JobQueue\\Jobs\\AssembleUploadChunksJob', 'PublishStashedFile' => 'MediaWiki\\JobQueue\\Jobs\\PublishStashedFileJob', 'ThumbnailRender' => 'MediaWiki\\JobQueue\\Jobs\\ThumbnailRenderJob', 'UploadFromUrl' => 'MediaWiki\\JobQueue\\Jobs\\UploadFromUrlJob', 'recentChangesUpdate' => 'MediaWiki\\RecentChanges\\RecentChangesUpdateJob', 'refreshLinksPrioritized' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'refreshLinksDynamic' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'activityUpdateJob' => 'MediaWiki\\Watchlist\\ActivityUpdateJob', 'categoryMembershipChange' => [ 'class' => 'MediaWiki\\RecentChanges\\CategoryMembershipChangeJob', 'services' => [ 'RecentChangeFactory', ], ], 'CategoryCountUpdateJob' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\CategoryCountUpdateJob', 'services' => [ 'ConnectionProvider', 'NamespaceInfo', ], ], 'clearUserWatchlist' => 'MediaWiki\\Watchlist\\ClearUserWatchlistJob', 'watchlistExpiry' => [ 'class' => 'MediaWiki\\Watchlist\\WatchlistExpiryJob', 'needsPage' => false, ], 'cdnPurge' => 'MediaWiki\\JobQueue\\Jobs\\CdnPurgeJob', 'userGroupExpiry' => 'MediaWiki\\User\\UserGroupExpiryJob', 'clearWatchlistNotifications' => 'MediaWiki\\Watchlist\\ClearWatchlistNotificationsJob', 'userOptionsUpdate' => 'MediaWiki\\User\\Options\\UserOptionsUpdateJob', 'revertedTagUpdate' => 'MediaWiki\\JobQueue\\Jobs\\RevertedTagUpdateJob', 'null' => 'MediaWiki\\JobQueue\\Jobs\\NullJob', 'userEditCountInit' => 'MediaWiki\\User\\UserEditCountInitJob', 'renameUserTable' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserTableJob', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', ], ], 'renameUserDerived' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserDerivedJob', 'services' => [ 'RenameUserFactory', 'UserFactory', ], ], 'renameUser' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserTableJob', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', ], ], ], 'JobTypesExcludedFromDefaultQueue' => [ 'AssembleUploadChunks', 'PublishStashedFile', 'UploadFromUrl', ], 'JobBackoffThrottling' => [ ], 'JobTypeConf' => [ 'default' => [ 'class' => 'MediaWiki\\JobQueue\\JobQueueDB', 'order' => 'random', 'claimTTL' => 3600, ], ], 'JobQueueIncludeInMaxLagFactor' => false, 'SpecialPageCacheUpdates' => [ 'Statistics' => [ 'MediaWiki\\Deferred\\SiteStatsUpdate', 'cacheUpdate', ], ], 'PagePropLinkInvalidations' => [ 'hiddencat' => 'categorylinks', ], 'CategoryMagicGallery' => true, 'CategoryPagingLimit' => 200, 'CategoryCollation' => 'uppercase', 'TempCategoryCollations' => [ ], 'SortedCategories' => false, 'TrackingCategories' => [ ], 'LogTypes' => [ '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'import', 'interwiki', 'patrol', 'merge', 'suppress', 'tag', 'managetags', 'contentmodel', 'renameuser', ], 'LogRestrictions' => [ 'suppress' => 'suppressionlog', ], 'FilterLogTypes' => [ 'patrol' => true, 'tag' => true, 'newusers' => false, ], 'LogNames' => [ '' => 'all-logs-page', 'block' => 'blocklogpage', 'protect' => 'protectlogpage', 'rights' => 'rightslog', 'delete' => 'dellogpage', 'upload' => 'uploadlogpage', 'move' => 'movelogpage', 'import' => 'importlogpage', 'patrol' => 'patrol-log-page', 'merge' => 'mergelog', 'suppress' => 'suppressionlog', ], 'LogHeaders' => [ '' => 'alllogstext', 'block' => 'blocklogtext', 'delete' => 'dellogpagetext', 'import' => 'importlogpagetext', 'merge' => 'mergelogpagetext', 'move' => 'movelogpagetext', 'patrol' => 'patrol-log-header', 'protect' => 'protectlogtext', 'rights' => 'rightslogtext', 'suppress' => 'suppressionlogtext', 'upload' => 'uploadlogpagetext', ], 'LogActions' => [ ], 'LogActionsHandlers' => [ 'block/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'block/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'block/unblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'contentmodel/change' => 'MediaWiki\\Logging\\ContentModelLogFormatter', 'contentmodel/new' => 'MediaWiki\\Logging\\ContentModelLogFormatter', 'delete/delete' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/delete_redir' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/delete_redir2' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/event' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/restore' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/revision' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'import/interwiki' => 'MediaWiki\\Logging\\ImportLogFormatter', 'import/upload' => 'MediaWiki\\Logging\\ImportLogFormatter', 'interwiki/iw_add' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'interwiki/iw_delete' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'interwiki/iw_edit' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'managetags/activate' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/create' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/deactivate' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/delete' => 'MediaWiki\\Logging\\LogFormatter', 'merge/merge' => [ 'class' => 'MediaWiki\\Logging\\MergeLogFormatter', 'services' => [ 'TitleParser', ], ], 'merge/merge-into' => [ 'class' => 'MediaWiki\\Logging\\MergeLogFormatter', 'services' => [ 'TitleParser', ], ], 'move/move' => [ 'class' => 'MediaWiki\\Logging\\MoveLogFormatter', 'services' => [ 'TitleParser', ], ], 'move/move_redir' => [ 'class' => 'MediaWiki\\Logging\\MoveLogFormatter', 'services' => [ 'TitleParser', ], ], 'patrol/patrol' => 'MediaWiki\\Logging\\PatrolLogFormatter', 'patrol/autopatrol' => 'MediaWiki\\Logging\\PatrolLogFormatter', 'protect/modify' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/move_prot' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/protect' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/unprotect' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'renameuser/renameuser' => [ 'class' => 'MediaWiki\\Logging\\RenameuserLogFormatter', 'services' => [ 'TitleParser', ], ], 'rights/autopromote' => 'MediaWiki\\Logging\\RightsLogFormatter', 'rights/rights' => 'MediaWiki\\Logging\\RightsLogFormatter', 'suppress/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'suppress/delete' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/event' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'suppress/revision' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'tag/update' => 'MediaWiki\\Logging\\TagLogFormatter', 'upload/overwrite' => 'MediaWiki\\Logging\\UploadLogFormatter', 'upload/revert' => 'MediaWiki\\Logging\\UploadLogFormatter', 'upload/upload' => 'MediaWiki\\Logging\\UploadLogFormatter', ], 'ActionFilteredLogs' => [ 'block' => [ 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], 'unblock' => [ 'unblock', ], ], 'contentmodel' => [ 'change' => [ 'change', ], 'new' => [ 'new', ], ], 'delete' => [ 'delete' => [ 'delete', ], 'delete_redir' => [ 'delete_redir', 'delete_redir2', ], 'restore' => [ 'restore', ], 'event' => [ 'event', ], 'revision' => [ 'revision', ], ], 'import' => [ 'interwiki' => [ 'interwiki', ], 'upload' => [ 'upload', ], ], 'managetags' => [ 'create' => [ 'create', ], 'delete' => [ 'delete', ], 'activate' => [ 'activate', ], 'deactivate' => [ 'deactivate', ], ], 'move' => [ 'move' => [ 'move', ], 'move_redir' => [ 'move_redir', ], ], 'newusers' => [ 'create' => [ 'create', 'newusers', ], 'create2' => [ 'create2', ], 'autocreate' => [ 'autocreate', ], 'byemail' => [ 'byemail', ], ], 'protect' => [ 'protect' => [ 'protect', ], 'modify' => [ 'modify', ], 'unprotect' => [ 'unprotect', ], 'move_prot' => [ 'move_prot', ], ], 'rights' => [ 'rights' => [ 'rights', ], 'autopromote' => [ 'autopromote', ], ], 'suppress' => [ 'event' => [ 'event', ], 'revision' => [ 'revision', ], 'delete' => [ 'delete', ], 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], ], 'upload' => [ 'upload' => [ 'upload', ], 'overwrite' => [ 'overwrite', ], 'revert' => [ 'revert', ], ], ], 'NewUserLog' => true, 'WatchUserPageOnAccountCreation' => true, 'PageCreationLog' => true, 'AllowSpecialInclusion' => true, 'DisableQueryPageUpdate' => false, 'CountCategorizedImagesAsUsed' => false, 'MaxRedirectLinksRetrieved' => 500, 'RangeContributionsCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 32, ], 'Actions' => [ ], 'DefaultRobotPolicy' => 'index,follow', 'NamespaceRobotPolicies' => [ ], 'ArticleRobotPolicies' => [ ], 'ExemptFromUserRobotsControl' => null, 'DebugAPI' => false, 'APIModules' => [ ], 'APIFormatModules' => [ ], 'APIMetaModules' => [ ], 'APIPropModules' => [ ], 'APIListModules' => [ ], 'APIMaxDBRows' => 5000, 'APIMaxResultSize' => 8388608, 'APIMaxUncachedDiffs' => 1, 'APIMaxLagThreshold' => 7, 'APICacheHelpTimeout' => 3600, 'APIUselessQueryPages' => [ 'MIMEsearch', 'LinkSearch', ], 'AjaxLicensePreview' => true, 'CrossSiteAJAXdomains' => [ ], 'CrossSiteAJAXdomainExceptions' => [ ], 'AllowedCorsHeaders' => [ 'Accept', 'Accept-Language', 'Content-Language', 'Content-Type', 'Accept-Encoding', 'DNT', 'Origin', 'User-Agent', 'Api-User-Agent', 'Promise-Non-Write-API-Action', 'Access-Control-Max-Age', 'Authorization', ], 'RestAPIAdditionalRouteFiles' => [ ], 'RestLocalModuleTestBaseUrl' => null, 'RestModuleOverrides' => [ ], 'RestExternalModules' => [ ], 'RestTermsOfServiceUrl' => null, 'MaxShellMemory' => 307200, 'MaxShellFileSize' => 102400, 'MaxShellTime' => 180, 'MaxShellWallClockTime' => 180, 'ShellCgroup' => false, 'PhpCli' => '/usr/bin/php', 'ShellRestrictionMethod' => 'autodetect', 'ShellboxUrls' => [ 'default' => null, ], 'ShellboxSecretKey' => null, 'ShellboxShell' => '/bin/sh', 'HTTPTimeout' => 25, 'HTTPConnectTimeout' => 5.0, 'HTTPMaxTimeout' => 0, 'HTTPMaxConnectTimeout' => 0, 'HTTPImportTimeout' => 25, 'HTTPUserAgentContact' => false, 'AsyncHTTPTimeout' => 25, 'HTTPProxy' => '', 'LocalVirtualHosts' => [ ], 'LocalHTTPProxy' => false, 'AllowExternalReqID' => false, 'GenerateReqIDFormat' => 'rand24', 'JobRunRate' => 1, 'RunJobsAsync' => false, 'UpdateRowsPerJob' => 300, 'UpdateRowsPerQuery' => 100, 'RedirectOnLogin' => null, 'EventRelayerConfig' => [ 'default' => [ 'class' => 'Wikimedia\\EventRelayer\\EventRelayerNull', ], ], 'Pingback' => false, 'OriginTrials' => [ ], 'ReportToExpiry' => 86400, 'ReportToEndpoints' => [ ], 'FeaturePolicyReportOnly' => [ ], 'SkinsPreferred' => [ 'vector-2022', 'vector', ], 'SpecialContributeSkinsEnabled' => [ ], 'SpecialContributeNewPageTarget' => null, 'EnableEditRecovery' => false, 'EditRecoveryExpiry' => 2592000, 'UseCodexSpecialBlock' => false, 'ShowLogoutConfirmation' => false, 'EnableProtectionIndicators' => true, 'OutputPipelineStages' => [ ], 'FeatureShutdown' => [ ], 'UseLeximorph' => false, 'UsePostprocCacheLegacy' => false, 'UsePostprocCacheParsoid' => true, 'ParserOptionsLogUnsafeSampleRate' => 0, 'ReturnExperimentalPFragmentTypes' => [ ], 'UseParsoidLinksUpdate' => null, 'UseParsoidMessages' => false, 'UseParsoidParser' => true, 'SiteLookup' => [ ], ], 'type' => [ 'ConfigRegistry' => 'object', 'AssumeProxiesUseDefaultProtocolPorts' => 'boolean', 'ForceHTTPS' => 'boolean', 'ExtensionDirectory' => [ 'string', 'null', ], 'StyleDirectory' => [ 'string', 'null', ], 'UploadDirectory' => [ 'string', 'boolean', 'null', ], 'Logos' => [ 'object', 'boolean', ], 'ReferrerPolicy' => [ 'array', 'string', 'boolean', ], 'ActionPaths' => 'object', 'MainPageIsDomainRoot' => 'boolean', 'ImgAuthUrlPathMap' => 'object', 'LocalFileRepo' => 'object', 'ForeignFileRepos' => 'array', 'UseSharedUploads' => 'boolean', 'SharedUploadDirectory' => [ 'string', 'null', ], 'SharedUploadPath' => [ 'string', 'null', ], 'HashedSharedUploadDirectory' => 'boolean', 'FetchCommonsDescriptions' => 'boolean', 'SharedUploadDBname' => [ 'boolean', 'string', ], 'SharedUploadDBprefix' => 'string', 'SharedUploadDBschema' => [ 'string', 'null', ], 'CacheSharedUploads' => 'boolean', 'ForeignUploadTargets' => 'array', 'UploadDialog' => 'object', 'FileBackends' => 'object', 'LockManagers' => 'array', 'DefaultLockManager' => [ 'string', 'null', ], 'CopyUploadsDomains' => 'array', 'CopyUploadTimeout' => [ 'boolean', 'integer', ], 'SharedThumbnailScriptPath' => [ 'string', 'boolean', ], 'HashedUploadDirectory' => 'boolean', 'CSPUploadEntryPoint' => 'boolean', 'FileExtensions' => 'array', 'ProhibitedFileExtensions' => 'array', 'MimeTypeExclusions' => 'array', 'TrustedMediaFormats' => 'array', 'MediaHandlers' => 'object', 'NativeImageLazyLoading' => 'boolean', 'ParserTestMediaHandlers' => 'object', 'MaxInterlacingAreas' => 'object', 'SVGConverters' => 'object', 'SVGNativeRendering' => [ 'string', 'boolean', ], 'MaxImageArea' => [ 'string', 'integer', 'boolean', ], 'TiffThumbnailType' => 'array', 'GenerateThumbnailOnParse' => 'boolean', 'EnableAutoRotation' => [ 'boolean', 'null', ], 'Antivirus' => [ 'string', 'null', ], 'AntivirusSetup' => 'object', 'MimeDetectorCommand' => [ 'string', 'null', ], 'XMLMimeTypes' => 'object', 'ImageLimits' => 'array', 'ThumbLimits' => 'array', 'ThumbnailNamespaces' => 'array', 'ThumbnailSteps' => [ 'array', 'null', ], 'ThumbnailBuckets' => [ 'array', 'null', ], 'UploadThumbnailRenderMap' => 'object', 'GalleryOptions' => 'object', 'DjvuDump' => [ 'string', 'null', ], 'DjvuRenderer' => [ 'string', 'null', ], 'DjvuTxt' => [ 'string', 'null', ], 'DjvuPostProcessor' => [ 'string', 'null', ], 'SMTP' => [ 'boolean', 'object', ], 'EnotifFromEditor' => 'boolean', 'EmailConfirmationBanner' => 'boolean', 'EnotifRevealEditorAddress' => 'boolean', 'UsersNotifiedOnAllChanges' => 'object', 'DBmwschema' => [ 'string', 'null', ], 'SharedTables' => 'array', 'DBservers' => [ 'boolean', 'array', ], 'LBFactoryConf' => 'object', 'LocalDatabases' => 'array', 'VirtualDomainsMapping' => 'object', 'RemoteVirtualDomainsMapping' => 'object', 'FileSchemaMigrationStage' => 'integer', 'ExternalLinksDomainGaps' => 'object', 'ContentHandlers' => 'object', 'NamespaceContentModels' => 'object', 'TextModelsToParse' => 'array', 'ExternalStores' => 'array', 'ExternalServers' => 'object', 'DefaultExternalStore' => [ 'array', 'boolean', ], 'RevisionCacheExpiry' => 'integer', 'PageLanguageUseDB' => 'boolean', 'DiffEngine' => [ 'string', 'null', ], 'ExternalDiffEngine' => [ 'string', 'boolean', ], 'Wikidiff2Options' => 'object', 'RequestTimeLimit' => [ 'integer', 'null', ], 'CriticalSectionTimeLimit' => 'number', 'PoolCounterConf' => [ 'object', 'null', ], 'PoolCountClientConf' => 'object', 'MaxUserDBWriteDuration' => [ 'integer', 'boolean', ], 'MaxJobDBWriteDuration' => [ 'integer', 'boolean', ], 'MultiShardSiteStats' => 'boolean', 'ObjectCaches' => 'object', 'WANObjectCache' => 'object', 'MicroStashType' => [ 'string', 'integer', ], 'ParsoidCacheConfig' => 'object', 'ParsoidSelectiveUpdateSampleRate' => 'integer', 'SplitParsoidParserCache' => 'boolean', 'ParserCacheFilterConfig' => 'object', 'ChronologyProtectorSecret' => 'string', 'SuspiciousIpExpiry' => [ 'integer', 'boolean', ], 'MemCachedServers' => 'array', 'LocalisationCacheConf' => 'object', 'ExtensionInfoMTime' => [ 'integer', 'boolean', ], 'CdnServers' => 'object', 'CdnServersNoPurge' => 'object', 'HTCPRouting' => 'object', 'GrammarForms' => 'object', 'ExtraInterlanguageLinkPrefixes' => 'array', 'InterlanguageLinkCodeMap' => 'object', 'ExtraLanguageNames' => 'object', 'ExtraLanguageCodes' => 'object', 'DummyLanguageCodes' => 'object', 'DisabledVariants' => 'object', 'ForceUIMsgAsContentMsg' => 'object', 'RawHtmlMessages' => 'array', 'OverrideUcfirstCharacters' => 'object', 'XhtmlNamespaces' => 'object', 'BrowserFormatDetection' => 'string', 'SkinMetaTags' => 'object', 'SkipSkins' => 'object', 'FragmentMode' => 'array', 'FooterIcons' => 'object', 'PageShareSkinsEnabled' => 'array', 'InterwikiLogoOverride' => 'array', 'ResourceModules' => 'object', 'ResourceModuleSkinStyles' => 'object', 'ResourceLoaderSources' => 'object', 'ResourceLoaderMaxage' => 'object', 'ResourceLoaderMaxQueryLength' => [ 'integer', 'boolean', ], 'CanonicalNamespaceNames' => 'object', 'ExtraNamespaces' => 'object', 'ExtraGenderNamespaces' => 'object', 'NamespaceAliases' => 'object', 'CapitalLinkOverrides' => 'object', 'NamespacesWithSubpages' => 'object', 'NamespacesWithoutAutoSummaries' => 'array', 'ContentNamespaces' => 'array', 'ShortPagesNamespaceExclusions' => 'array', 'ExtraSignatureNamespaces' => 'array', 'InvalidRedirectTargets' => 'array', 'LocalInterwikis' => 'array', 'InterwikiCache' => [ 'boolean', 'object', ], 'SiteTypes' => 'object', 'UrlProtocols' => 'array', 'TidyConfig' => 'object', 'ParsoidSettings' => 'object', 'ParsoidExperimentalParserFunctionOutput' => 'boolean', 'NoFollowNsExceptions' => 'array', 'NoFollowDomainExceptions' => 'array', 'ExternalLinksIgnoreDomains' => 'array', 'EnableMagicLinks' => 'object', 'ManualRevertSearchRadius' => 'integer', 'RevertedTagMaxDepth' => 'integer', 'CentralIdLookupProviders' => 'object', 'CentralIdLookupProvider' => 'string', 'UserRegistrationProviders' => 'object', 'PasswordPolicy' => 'object', 'AuthManagerConfig' => [ 'object', 'null', ], 'AuthManagerAutoConfig' => 'object', 'RememberMe' => 'string', 'ReauthenticateTime' => 'object', 'ChangeCredentialsBlacklist' => 'array', 'RemoveCredentialsBlacklist' => 'array', 'PasswordConfig' => 'object', 'PasswordResetRoutes' => 'object', 'SignatureAllowedLintErrors' => 'array', 'ReservedUsernames' => 'array', 'DefaultUserOptions' => 'object', 'ConditionalUserOptions' => 'object', 'HiddenPrefs' => 'array', 'UserJsPrefLimit' => 'integer', 'AuthenticationTokenVersion' => [ 'string', 'null', ], 'SessionProviders' => 'object', 'AutoCreateTempUser' => 'object', 'AutoblockExemptions' => 'array', 'BlockCIDRLimit' => 'object', 'EnableMultiBlocks' => 'boolean', 'GroupPermissions' => 'object', 'PrivilegedGroups' => 'array', 'RevokePermissions' => 'object', 'GroupInheritsPermissions' => 'object', 'ImplicitGroups' => 'array', 'GroupsAddToSelf' => 'object', 'GroupsRemoveFromSelf' => 'object', 'RestrictedGroups' => 'object', 'UserRequirementsPrivateConditions' => 'array', 'RestrictionTypes' => 'array', 'RestrictionLevels' => 'array', 'CascadingRestrictionLevels' => 'array', 'SemiprotectedRestrictionLevels' => 'array', 'NamespaceProtection' => 'object', 'RestrictUserPageEditing' => 'boolean', 'NonincludableNamespaces' => 'object', 'Autopromote' => 'object', 'AutopromoteOnce' => 'object', 'AutopromoteOnceRCExcludedGroups' => 'array', 'AddGroups' => 'object', 'RemoveGroups' => 'object', 'AvailableRights' => 'array', 'ImplicitRights' => 'array', 'AccountCreationThrottle' => [ 'integer', 'array', ], 'TempAccountCreationThrottle' => 'array', 'TempAccountNameAcquisitionThrottle' => 'array', 'SpamRegex' => 'array', 'SummarySpamRegex' => 'array', 'DnsBlacklistUrls' => 'array', 'ProxyList' => [ 'string', 'array', ], 'ProxyWhitelist' => 'array', 'SoftBlockRanges' => 'array', 'RateLimits' => 'object', 'RateLimitsExcludedIPs' => 'array', 'ExternalQuerySources' => 'object', 'PasswordAttemptThrottle' => 'array', 'GrantPermissions' => 'object', 'GrantPermissionGroups' => 'object', 'GrantRiskGroups' => 'object', 'EnableBotPasswords' => 'boolean', 'BotPasswordsCluster' => [ 'string', 'boolean', ], 'BotPasswordsDatabase' => [ 'string', 'boolean', ], 'BotPasswordsLimit' => 'integer', 'ReauthenticateForActions' => 'object', 'CSPHeader' => [ 'boolean', 'object', ], 'CSPReportOnlyHeader' => [ 'boolean', 'object', ], 'CSPUseReportURIDirective' => [ 'boolean', 'object', ], 'CSPFalsePositiveUrls' => 'object', 'AllowCrossOrigin' => 'boolean', 'RestAllowCrossOriginCookieAuth' => 'boolean', 'CookieSameSite' => [ 'string', 'null', ], 'CacheVaryCookies' => 'array', 'DeviceBoundSessions' => 'boolean', 'DeviceBoundSessionsReportOnly' => 'boolean', 'DeviceBoundSessionCookieName' => 'string', 'DeviceBoundSessionCredentialTTL' => 'integer', 'DeviceBoundSessionChallengeTTL' => 'integer', 'DeviceBoundSessionBindingTTL' => 'integer', 'DeviceBoundSessionScopeExcludes' => 'array', 'TrxProfilerLimits' => 'object', 'DebugLogGroups' => 'object', 'MWLoggerDefaultSpi' => 'object', 'Profiler' => 'object', 'StatsTarget' => [ 'string', 'null', ], 'StatsFormat' => [ 'string', 'null', ], 'StatsPrefix' => 'string', 'OpenTelemetryConfig' => [ 'object', 'null', ], 'OpenSearchTemplates' => 'object', 'NamespacesToBeSearchedDefault' => 'object', 'SitemapNamespaces' => [ 'boolean', 'array', ], 'SitemapNamespacesPriorities' => [ 'boolean', 'object', ], 'SitemapApiConfig' => 'object', 'SpecialSearchFormOptions' => 'object', 'SearchMatchRedirectPreference' => 'boolean', 'SearchRunSuggestedQuery' => 'boolean', 'PreviewOnOpenNamespaces' => 'object', 'ReadOnlyWatchedItemStore' => 'boolean', 'GitRepositoryViewers' => 'object', 'InstallerInitialPages' => 'array', 'RCLinkLimits' => 'array', 'RCLinkDays' => 'array', 'RCFeeds' => 'object', 'OverrideSiteFeed' => 'object', 'FeedClasses' => 'object', 'AdvertisedFeedTypes' => 'array', 'SoftwareTags' => 'object', 'RestrictedTagViewRights' => 'object', 'RecentChangesFlags' => 'object', 'WatchlistExpiry' => 'boolean', 'EnableWatchstarPopover' => 'boolean', 'EnableWatchlistLabels' => 'boolean', 'WatchlistLabelsMaxPerUser' => 'integer', 'WatchlistPurgeRate' => 'number', 'WatchlistExpiryMaxDuration' => [ 'string', 'null', ], 'EnableChangesListQueryPartitioning' => 'boolean', 'ImportSources' => 'object', 'ExtensionFunctions' => 'array', 'ExtensionMessagesFiles' => 'object', 'MessagesDirs' => 'object', 'TranslationAliasesDirs' => 'object', 'ExtensionEntryPointListFiles' => 'object', 'ValidSkinNames' => 'object', 'SpecialPages' => 'object', 'ExtensionCredits' => 'object', 'Hooks' => 'object', 'ServiceWiringFiles' => 'array', 'JobClasses' => 'object', 'JobTypesExcludedFromDefaultQueue' => 'array', 'JobBackoffThrottling' => 'object', 'JobTypeConf' => 'object', 'SpecialPageCacheUpdates' => 'object', 'PagePropLinkInvalidations' => 'object', 'TempCategoryCollations' => 'array', 'SortedCategories' => 'boolean', 'TrackingCategories' => 'array', 'LogTypes' => 'array', 'LogRestrictions' => 'object', 'FilterLogTypes' => 'object', 'LogNames' => 'object', 'LogHeaders' => 'object', 'LogActions' => 'object', 'LogActionsHandlers' => 'object', 'ActionFilteredLogs' => 'object', 'WatchUserPageOnAccountCreation' => 'boolean', 'RangeContributionsCIDRLimit' => 'object', 'Actions' => 'object', 'NamespaceRobotPolicies' => 'object', 'ArticleRobotPolicies' => 'object', 'ExemptFromUserRobotsControl' => [ 'array', 'null', ], 'APIModules' => 'object', 'APIFormatModules' => 'object', 'APIMetaModules' => 'object', 'APIPropModules' => 'object', 'APIListModules' => 'object', 'APIUselessQueryPages' => 'array', 'CrossSiteAJAXdomains' => 'object', 'CrossSiteAJAXdomainExceptions' => 'object', 'AllowedCorsHeaders' => 'array', 'RestAPIAdditionalRouteFiles' => 'array', 'RestLocalModuleTestBaseUrl' => [ 'string', 'null', ], 'RestModuleOverrides' => 'object', 'RestExternalModules' => 'object', 'RestTermsOfServiceUrl' => [ 'string', 'null', ], 'ShellRestrictionMethod' => [ 'string', 'boolean', ], 'ShellboxUrls' => 'object', 'ShellboxSecretKey' => [ 'string', 'null', ], 'ShellboxShell' => [ 'string', 'null', ], 'HTTPTimeout' => 'number', 'HTTPConnectTimeout' => 'number', 'HTTPMaxTimeout' => 'number', 'HTTPMaxConnectTimeout' => 'number', 'HTTPUserAgentContact' => [ 'string', 'boolean', ], 'LocalVirtualHosts' => 'object', 'LocalHTTPProxy' => [ 'string', 'boolean', ], 'GenerateReqIDFormat' => 'string', 'EventRelayerConfig' => 'object', 'Pingback' => 'boolean', 'OriginTrials' => 'array', 'ReportToExpiry' => 'integer', 'ReportToEndpoints' => 'array', 'FeaturePolicyReportOnly' => 'array', 'SkinsPreferred' => 'array', 'SpecialContributeSkinsEnabled' => 'array', 'SpecialContributeNewPageTarget' => [ 'string', 'null', ], 'EnableEditRecovery' => 'boolean', 'EditRecoveryExpiry' => 'integer', 'UseCodexSpecialBlock' => 'boolean', 'ShowLogoutConfirmation' => 'boolean', 'EnableProtectionIndicators' => 'boolean', 'OutputPipelineStages' => 'object', 'FeatureShutdown' => 'array', 'UseLeximorph' => 'boolean', 'UsePostprocCacheLegacy' => 'boolean', 'UsePostprocCacheParsoid' => 'boolean', 'ParserOptionsLogUnsafeSampleRate' => 'integer', 'ReturnExperimentalPFragmentTypes' => 'array', 'UseParsoidLinksUpdate' => [ 'boolean', 'null', ], 'UseParsoidMessages' => [ 'boolean', 'null', ], 'UseParsoidParser' => 'boolean', 'SiteLookup' => 'object', ], 'mergeStrategy' => [ 'TiffThumbnailType' => 'replace', 'LBFactoryConf' => 'replace', 'InterwikiCache' => 'replace', 'PasswordPolicy' => 'array_replace_recursive', 'AuthManagerAutoConfig' => 'array_plus_2d', 'GroupPermissions' => 'array_plus_2d', 'RevokePermissions' => 'array_plus_2d', 'AddGroups' => 'array_merge_recursive', 'RemoveGroups' => 'array_merge_recursive', 'RateLimits' => 'array_plus_2d', 'GrantPermissions' => 'array_plus_2d', 'MWLoggerDefaultSpi' => 'replace', 'Profiler' => 'replace', 'Hooks' => 'array_merge_recursive', 'RestModuleOverrides' => 'array_replace_recursive', 'RestExternalModules' => 'array_replace_recursive', ], 'dynamicDefault' => [ 'UsePathInfo' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUsePathInfo', ], ], 'Script' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultScript', ], ], 'LoadScript' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLoadScript', ], ], 'RestPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultRestPath', ], ], 'StylePath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultStylePath', ], ], 'LocalStylePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalStylePath', ], ], 'ExtensionAssetsPath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultExtensionAssetsPath', ], ], 'ArticlePath' => [ 'use' => [ 'Script', 'UsePathInfo', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultArticlePath', ], ], 'UploadPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUploadPath', ], ], 'FileCacheDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultFileCacheDirectory', ], ], 'Logo' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLogo', ], ], 'DeletedDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDeletedDirectory', ], ], 'ShowEXIF' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultShowEXIF', ], ], 'SharedPrefix' => [ 'use' => [ 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedPrefix', ], ], 'SharedSchema' => [ 'use' => [ 'DBmwschema', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedSchema', ], ], 'DBerrorLogTZ' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDBerrorLogTZ', ], ], 'Localtimezone' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocaltimezone', ], ], 'LocalTZoffset' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalTZoffset', ], ], 'ResourceBasePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultResourceBasePath', ], ], 'MetaNamespace' => [ 'use' => [ 'Sitename', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultMetaNamespace', ], ], 'CookieSecure' => [ 'use' => [ 'ForceHTTPS', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookieSecure', ], ], 'CookiePrefix' => [ 'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookiePrefix', ], ], 'ReadOnlyFile' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultReadOnlyFile', ], ], ], ], 'config-schema' => [ 'UploadStashScalerBaseUrl' => [ 'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo', ], 'IllegalFileChars' => [ 'deprecated' => 'since 1.41; no longer customizable', ], 'ThumbnailNamespaces' => [ 'items' => [ 'type' => 'integer', ], ], 'LocalDatabases' => [ 'items' => [ 'type' => 'string', ], ], 'ParserCacheFilterConfig' => [ 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of namespace IDs to filter definitions.', 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of filter names to values.', 'properties' => [ 'minCpuTime' => [ 'type' => 'number', ], ], ], ], ], 'RawHtmlMessages' => [ 'items' => [ 'type' => 'string', ], ], 'InterwikiLogoOverride' => [ 'items' => [ 'type' => 'string', ], ], 'LegalTitleChars' => [ 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize', ], 'ReauthenticateTime' => [ 'additionalProperties' => [ 'type' => [ 'integer', 'array', ], ], ], 'ChangeCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'RemoveCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'GroupPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GroupInheritsPermissions' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'AvailableRights' => [ 'items' => [ 'type' => 'string', ], ], 'ImplicitRights' => [ 'items' => [ 'type' => 'string', ], ], 'SoftBlockRanges' => [ 'items' => [ 'type' => 'string', ], ], 'ExternalQuerySources' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'enabled' => [ 'type' => 'boolean', 'default' => false, ], 'url' => [ 'type' => 'string', 'format' => 'uri', ], 'timeout' => [ 'type' => 'integer', 'default' => 10, ], ], 'required' => [ 'enabled', 'url', ], 'additionalProperties' => false, ], ], 'GrantPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GrantPermissionGroups' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'SitemapNamespacesPriorities' => [ 'deprecated' => 'since 1.45 and ignored', ], 'SitemapApiConfig' => [ 'additionalProperties' => [ 'enabled' => [ 'type' => 'bool', ], 'sitemapsPerIndex' => [ 'type' => 'int', ], 'pagesPerSitemap' => [ 'type' => 'int', ], 'expiry' => [ 'type' => 'int', ], 'skipRedirects' => [ 'type' => 'bool', ], ], ], 'SoftwareTags' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], 'UseCopyrightUpload' => [ 'deprecated' => 'since 1.47 This feature is being removed.', ], 'JobBackoffThrottling' => [ 'additionalProperties' => [ 'type' => 'number', ], ], 'JobTypeConf' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'class' => [ 'type' => 'string', ], 'order' => [ 'type' => 'string', ], 'claimTTL' => [ 'type' => 'integer', ], ], ], ], 'TrackingCategories' => [ 'deprecated' => 'since 1.25 Extensions should now register tracking categories using the new extension registration system.', ], 'RangeContributionsCIDRLimit' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'RestModuleOverrides' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'availability' => [ 'type' => 'string', ], 'groups' => [ 'type' => 'array', ], ], ], ], 'RestExternalModules' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'info' => [ 'type' => 'object', 'properties' => [ 'version' => [ 'type' => 'string', ], 'title' => [ 'type' => 'string', ], 'x-i18n-title' => [ 'type' => 'string', ], 'description' => [ 'type' => 'string', ], 'x-i18n-description' => [ 'type' => 'string', ], ], 'required' => [ 'version', ], ], 'base' => [ 'type' => 'string', 'format' => 'uri', ], 'spec' => [ 'type' => 'string', 'format' => 'uri', ], ], 'required' => [ 'info', 'base', 'spec', ], ], ], 'ShellboxUrls' => [ 'additionalProperties' => [ 'type' => [ 'string', 'boolean', 'null', ], ], ], ], 'obsolete-config' => [ 'MangleFlashPolicy' => 'Since 1.39; no longer has any effect.', 'EnableOpenSearchSuggest' => 'Since 1.35, no longer used', 'AutoloadAttemptLowercase' => 'Since 1.40; no longer has any effect.', ],]
$wgDefaultUserOptions
Config variable stub for the DefaultUserOptions setting, for use by phpdoc and IDEs.
Interface for objects which can provide a MediaWiki context on request.
The shared interface for all language converters.
Interface for localizing messages in MediaWiki.
msg( $key,... $params)
This is the method for getting translated interface messages.
Base interface for user preference filters that work as a middleware between storage and interface.
Definition Filter.php:13
A PreferencesFactory is a MediaWiki service that provides the definitions of preferences for a given ...
Interface for objects representing user identity.
Interface for database access objects.
element(SerializerNode $parent, SerializerNode $node, $contents)