136 use DeprecationHelper;
137 use ProtectedHookAccessorTrait;
182 private $mContextTitle =
null;
188 private $action =
'submit';
197 private $isNew =
false;
209 private $mTokenOk =
false;
212 private $mTriedSave =
false;
215 private $incompleteForm =
false;
218 private $missingSummary =
false;
220 private bool $allowBlankSummary =
false;
225 private bool $allowBlankArticle =
false;
228 private $problematicRedirectTarget =
null;
231 private $allowedProblematicRedirectTarget =
null;
233 private bool $ignoreProblematicRedirects =
false;
235 private string $autoSumm =
'';
238 private $hookError =
'';
241 private $mParserOutput;
255 private $diff =
false;
257 private bool $minoredit =
false;
259 private bool $watchthis =
false;
262 private $watchlistExpiryEnabled;
267 private ?
string $watchlistExpiry =
null;
269 private bool $recreate =
false;
272 private $ignoreRevisionDeletedWarning =
false;
283 private $textbox2 =
'';
291 private $nosummary =
false;
311 private ?
int $editRevId =
null;
317 private ?
string $newSectionAnchor =
null;
338 private int $parentRevId = 0;
341 private $scrolltop =
null;
343 private bool $markAsBot =
true;
349 private ?array $changeTags =
null;
351 # Placeholders for text injection by hooks (must be HTML)
352 # extensions should take care to _append_ to the present value
374 private int $undoAfter = 0;
379 private int|
false $contentLength =
false;
384 private bool $enableApiEditOverride =
false;
391 private $isOldRev =
false;
396 private ?
string $unicodeCheck =
null;
399 private $editConflictHelperFactory =
null;
417 private $placeholderTempUser;
420 private $unsavedTempUser;
423 private $savedTempUser;
426 private bool $tempUserCreateActive =
false;
429 private $tempUserName;
432 private $tempUserCreateDone =
false;
435 private bool $unableToAcquireTempName =
false;
446 $this->mArticle = $article;
447 $this->page = $article->
getPage();
455 $this->context->setWikiPage( $this->page );
457 $this->contentModel = $this->
getTitle()->getContentModel();
461 $this->contentFormat = $this->contentHandlerFactory
462 ->getContentHandler( $this->contentModel )
463 ->getDefaultFormat();
466 $this->watchlistExpiryEnabled = $this->
getContext()->getConfig() instanceof
Config
480 $this->constraintFactory = $services->
getService(
'_EditConstraintFactory' );
481 $this->pageEditingHelper = $services->
getService(
'_PageEditingHelper' );
483 $this->deprecatePublicProperty(
'textbox2',
'1.44', __CLASS__ );
484 $this->deprecatePublicProperty(
'action',
'1.38', __CLASS__ );
491 return $this->mArticle;
507 return $this->page->getTitle();
514 $this->mContextTitle = $title;
522 if ( $this->mContextTitle ===
null ) {
523 throw new RuntimeException(
"EditPage does not have a context title set" );
525 return $this->mContextTitle;
535 $this->enableApiEditOverride = $enableOverride;
551 if ( !$this->getHookRunner()->onAlternateEdit( $this ) ) {
555 wfDebug( __METHOD__ .
": enter" );
557 $request = $this->context->getRequest();
559 if ( $request->
getBool(
'redlink' ) && $this->page->exists() ) {
560 $this->context->getOutput()->redirect( $this->getTitle()->getFullURL() );
564 $this->importFormData( $request );
565 $this->firsttime =
false;
568 if ( $this->save && $readOnlyMode->isReadOnly() ) {
571 $this->preview =
true;
575 $this->formtype =
'save';
576 } elseif ( $this->preview ) {
577 $this->formtype =
'preview';
578 } elseif ( $this->diff ) {
579 $this->formtype =
'diff';
580 }
else { # First time through
581 $this->firsttime =
true;
582 if ( $this->previewOnOpen() ) {
583 $this->formtype =
'preview';
585 $this->formtype =
'initial';
593 $this->unableToAcquireTempName = !$this->maybeActivateTempUserCreate( !$this->firsttime )->isOK();
595 $status = $this->getEditPermissionStatus(
596 $this->save ? PermissionManager::RIGOR_SECURE : PermissionManager::RIGOR_FULL
598 if ( !$status->isGood() ) {
599 wfDebug( __METHOD__ .
": User can't edit" );
601 $user = $this->context->getUser();
602 if ( $user->getBlock() && !$readOnlyMode->isReadOnly() ) {
604 $user->scheduleSpreadBlock();
606 $this->displayPermissionStatus( $status );
611 $revRecord = $this->mArticle->fetchRevisionRecord();
614 $revContentModel = $revRecord ?
615 $revRecord->getMainContentModel() :
617 if ( $revContentModel && $revContentModel !== $this->contentModel ) {
618 $prevRevRecord =
null;
619 $prevContentModel =
false;
620 if ( $this->undidRev ) {
621 $undidRevRecord = $this->revisionStore
622 ->getRevisionById( $this->undidRev );
623 $prevRevRecord = $undidRevRecord ?
624 $this->revisionStore->getPreviousRevision( $undidRevRecord ) :
627 $prevContentModel = $prevRevRecord ?
628 $prevRevRecord->getMainContentModel() :
632 if ( !$this->undidRev
634 || $prevContentModel !== $this->contentModel
636 $this->displayViewSourcePage(
637 $this->getContentObject(),
639 'contentmodelediterror',
648 $this->isConflict =
false;
650 # Attempt submission here. This will check for edit conflicts,
651 # and redundantly check for locked database, blocked IPs, etc.
652 # that edit() already checked just in case someone tries to sneak
653 # in the back door with a hand-edited submission URL.
655 if ( $this->formtype ===
'save' ) {
656 $resultDetails =
null;
657 $status = $this->attemptSave( $resultDetails );
662 if ( !$this->handleStatus( $status, $resultDetails ) ) {
667 # First time through: get contents, set time for conflict
669 if ( $this->formtype ===
'initial' || $this->firsttime ) {
670 if ( !$this->initialiseForm() ) {
674 if ( $this->page->getId() ) {
675 $this->getHookRunner()->onEditFormInitialText( $this );
685 $curRevisionRecord = $this->page->getRevisionRecord();
686 if ( $curRevisionRecord
688 && $curRevisionRecord->getId() !== $revRecord->getId()
689 && ( WikiPage::hasDifferencesOutsideMainSlot(
692 ) || !$this->pageEditingHelper->isSupportedContentModel(
697 $this->enableApiEditOverride
700 $restoreLink = $this->getTitle()->getFullURL(
702 'action' =>
'mcrrestore',
703 'restore' => $revRecord->getId(),
706 $this->displayViewSourcePage(
707 $this->getContentObject(),
709 'nonmain-slot-differences-therefore-readonly',
716 $this->showEditForm();
729 if ( $this->tempUserCreateActive ) {
731 return Status::newGood();
733 $user = $this->context->getUser();
738 if ( $user->isTemp() ) {
739 $expiryAfterDays = $this->tempUserCreator->getExpireAfterDays();
740 if ( $expiryAfterDays ) {
741 $expirationCutoff = (int)ConvertibleTimestamp::now( TS::UNIX ) - ( 86_400 * $expiryAfterDays );
747 $firstUserRegistration = $this->userRegistrationLookup->getFirstRegistration( $user );
749 $firstUserRegistration &&
750 ConvertibleTimestamp::convert( TS::UNIX, $firstUserRegistration ) < $expirationCutoff
756 $session = $this->context->getRequest()->getSession();
757 $session->set(
'TempUser:name',
null );
761 $this->sessionManager->invalidateSessionsForUser(
762 $this->userFactory->newFromUserIdentity( $user )
768 if ( $this->tempUserCreator->shouldAutoCreate( $user,
'edit' ) ) {
770 $name = $this->tempUserCreator->acquireAndStashName(
771 $this->context->getRequest()->getSession() );
772 if ( $name ===
null ) {
773 $status = Status::newFatal(
'temp-user-unable-to-acquire' );
774 $status->value = self::AS_UNABLE_TO_ACQUIRE_TEMP_ACCOUNT;
777 $this->unsavedTempUser = $this->userFactory->newUnsavedTempUser( $name );
778 $this->tempUserName = $name;
780 $this->placeholderTempUser = $this->userFactory->newTempPlaceholder();
782 $this->tempUserCreateActive =
true;
784 return Status::newGood();
794 private function createTempUser(): Status {
795 if ( !$this->tempUserCreateActive ) {
796 return Status::newGood();
798 $request = $this->context->getRequest();
799 $status = $this->tempUserCreator->create(
803 if ( $status->isOK() ) {
804 $this->placeholderTempUser =
null;
805 $this->unsavedTempUser =
null;
806 $this->savedTempUser = $status->getUser();
807 $this->authManager->setRequestContextUserFromSessionUser();
808 $this->tempUserCreateDone =
true;
810 LoggerFactory::getInstance(
'authevents' )->info(
811 'Temporary account creation attempt: {user}',
813 'user' => $this->tempUserName,
814 'success' => $status->isOK(),
830 return $this->getUserForPermissions();
839 private function getUserForPermissions() {
840 if ( $this->savedTempUser ) {
841 return $this->savedTempUser;
842 } elseif ( $this->unsavedTempUser ) {
843 return $this->unsavedTempUser;
844 } elseif ( $this->placeholderTempUser ) {
845 return $this->placeholderTempUser;
847 return $this->context->getUser();
857 private function getUserForPreview() {
858 if ( $this->savedTempUser ) {
859 return $this->savedTempUser;
860 } elseif ( $this->unsavedTempUser ) {
861 return $this->unsavedTempUser;
862 } elseif ( $this->firsttime && $this->placeholderTempUser ) {
866 return $this->placeholderTempUser;
867 } elseif ( $this->tempUserCreateActive ) {
868 throw new BadMethodCallException(
869 "Can't use the request user for preview with IP masking enabled" );
871 return $this->context->getUser();
881 private function getUserForSave() {
882 if ( $this->savedTempUser ) {
883 return $this->savedTempUser;
884 } elseif ( $this->tempUserCreateActive ) {
885 throw new BadMethodCallException(
886 "Can't use the request user for storage with IP masking enabled" );
888 return $this->context->getUser();
896 private function getEditPermissionStatus(
string $rigor = PermissionManager::RIGOR_SECURE ): PermissionStatus {
897 $user = $this->getUserForPermissions();
898 return $this->permManager->getPermissionStatus(
917 private function displayPermissionStatus( PermissionStatus $status ): void {
919 if ( $this->context->getRequest()->getBool(
'redlink' ) ) {
923 $out->redirect( $this->getTitle()->getFullURL() );
927 $content = $this->getContentObject();
931 if ( !$content || ( $this->firsttime && !$this->page->exists() && $content->isEmpty() ) ) {
932 $action = $this->page->exists() ?
'edit' :
933 ( $this->getTitle()->isTalkPage() ?
'createtalk' :
'createpage' );
934 throw new PermissionsError( $action, $status );
937 $this->displayViewSourcePage(
939 $out->formatPermissionStatus( $status,
'edit' )
948 private function displayViewSourcePage( Content $content,
string $errorMessage ): void {
950 $this->getHookRunner()->onEditPage__showReadOnlyForm_initial( $this, $out );
952 $out->setRobotPolicy(
'noindex,nofollow' );
953 $out->setPageTitleMsg( $this->context->msg(
956 $this->getContextTitle()->getPrefixedText()
958 $out->addBacklinkSubtitle( $this->getContextTitle() );
959 $out->addHTML( $this->editFormPageTop );
960 $out->addHTML( $this->editFormTextTop );
962 if ( $errorMessage !==
'' ) {
963 $out->addWikiTextAsInterface( $errorMessage );
964 $out->addHTML(
"<hr />\n" );
967 # If the user made changes, preserve them when showing the markup
968 # (This happens when a user is blocked during edit, for instance)
969 if ( !$this->firsttime ) {
970 $text = $this->textbox1;
971 $out->addWikiMsg(
'viewyourtext' );
975 $text = $this->pageEditingHelper->toEditText(
976 $content, $this->contentFormat, $this->enableApiEditOverride
977 ) ?? $content->serialize();
978 $out->addWikiMsg(
'viewsourcetext' );
981 $out->addHTML( $this->editFormTextBeforeContent );
982 $this->showTextbox( $text,
'wpTextbox1', [
'readonly' ] );
983 $out->addHTML( $this->editFormTextAfterContent );
985 $out->addHTML( $this->makeTemplatesOnThisPageList( $this->getTemplates() ) );
987 $out->addModules(
'mediawiki.action.edit.collapsibleFooter' );
989 $out->addHTML( $this->editFormTextBottom );
990 if ( $this->page->exists() ) {
991 $out->returnToMain(
null, $this->page );
1001 $config = $this->context->getConfig();
1002 $previewOnOpenNamespaces = $config->get( MainConfigNames::PreviewOnOpenNamespaces );
1003 $request = $this->context->getRequest();
1004 if ( $config->get( MainConfigNames::RawHtml ) ) {
1010 $preview = $request->
getRawVal(
'preview' );
1011 if ( $preview ===
'yes' ) {
1014 } elseif ( $preview ===
'no' ) {
1017 } elseif ( $this->section ===
'new' ) {
1020 } elseif ( ( $request->
getCheck(
'preload' ) || $this->page->exists() )
1021 && $this->userOptionsLookup->getOption( $this->context->getUser(),
'previewonfirst' )
1025 } elseif ( !$this->page->exists()
1026 && isset( $previewOnOpenNamespaces[$this->page->getNamespace()] )
1027 && $previewOnOpenNamespaces[$this->page->getNamespace()]
1042 private function isSectionEditSupported(): bool {
1043 $currentRev = $this->page->getRevisionRecord();
1046 $revContentModel = $currentRev
1047 ? $currentRev->getMainContentModel()
1048 : $this->page->getContentModel();
1051 ( $this->mArticle->getRevIdFetched() === $this->page->getLatest() ) &&
1052 $this->contentHandlerFactory->getContentHandler( $revContentModel )->supportsSections()
1062 # Section edit can come from either the form or a link
1063 $this->section = $request->
getVal(
'wpSection', $request->
getVal(
'section',
'' ) );
1065 if ( $this->section !==
null && $this->section !==
'' && !$this->isSectionEditSupported() ) {
1066 throw new ErrorPageError(
'sectioneditnotsupported-title',
'sectioneditnotsupported-text' );
1069 $this->isNew = !$this->page->exists() || $this->section ===
'new';
1072 $this->importFormDataPosted( $request );
1074 # Not a posted form? Start with nothing.
1075 wfDebug( __METHOD__ .
": Not a posted form." );
1076 $this->textbox1 =
'';
1077 $this->summary =
'';
1078 $this->sectiontitle =
null;
1079 $this->edittime =
'';
1080 $this->editRevId =
null;
1082 $this->preview =
false;
1083 $this->save =
false;
1084 $this->diff =
false;
1085 $this->minoredit =
false;
1087 $this->watchthis = $request->
getBool(
'watchthis',
false );
1088 if ( $this->watchlistExpiryEnabled ) {
1089 $this->watchlistExpiry =
null;
1091 $this->recreate =
false;
1095 if ( $this->section ===
'new' && $request->
getCheck(
'preloadtitle' ) ) {
1096 $this->sectiontitle = $request->
getVal(
'preloadtitle' );
1097 $this->setNewSectionSummary();
1098 } elseif ( $this->section !==
'new' && $request->
getRawVal(
'summary' ) !==
'' ) {
1099 $this->summary = $request->
getText(
'summary' );
1100 if ( $this->summary !==
'' ) {
1104 $this->autoSumm = md5(
'' );
1108 if ( $request->
getVal(
'minor' ) ) {
1109 $this->minoredit =
true;
1113 $this->oldid = $request->
getInt(
'oldid' );
1114 $this->parentRevId = $request->
getInt(
'parentRevId' );
1116 $this->markAsBot = $request->
getBool(
'bot',
true );
1117 $this->nosummary = $request->
getBool(
'nosummary' );
1120 $this->contentModel = $request->
getText(
'model', $this->contentModel );
1122 $this->contentFormat = $request->
getText(
'format', $this->contentFormat );
1125 $handler = $this->contentHandlerFactory->getContentHandler( $this->contentModel );
1128 'editpage-invalidcontentmodel-title',
1129 'editpage-invalidcontentmodel-text',
1134 if ( !$handler->isSupportedFormat( $this->contentFormat ) ) {
1136 'editpage-notsupportedcontentformat-title',
1137 'editpage-notsupportedcontentformat-text',
1140 wfEscapeWikiText( ContentHandler::getLocalizedName( $this->contentModel ) )
1146 $this->getHookRunner()->onEditPage__importFormData( $this, $request );
1149 private function importFormDataPosted(
WebRequest $request ): void {
1150 # These fields need to be checked for encoding.
1151 # Also remove trailing whitespace, but don
't remove _initial_
1152 # whitespace from the text boxes. This may be significant formatting.
1153 $this->textbox1 = rtrim( $request->getText( 'wpTextbox1
' ) );
1154 if ( !$request->getCheck( 'wpTextbox2
' ) ) {
1155 // Skip this if wpTextbox2 has input, it indicates that we came
1156 // from a conflict page with raw page text, not a custom form
1157 // modified by subclasses
1158 $textbox1 = $this->importContentFormData( $request );
1159 if ( $textbox1 !== null ) {
1160 $this->textbox1 = $textbox1;
1164 $this->unicodeCheck = $request->getText( 'wpUnicodeCheck
' );
1166 if ( $this->section === 'new
' ) {
1167 # Allow setting sectiontitle different from the edit summary.
1168 # Note that wpSectionTitle is not yet a part of the actual edit form, as wpSummary is
1169 # currently doing double duty as both edit summary and section title. Right now this
1170 # is just to allow API edits to work around this limitation, but this should be
1171 # incorporated into the actual edit form when EditPage is rewritten (T20654, T28312).
1172 if ( $request->getCheck( 'wpSectionTitle
' ) ) {
1173 $this->sectiontitle = $request->getText( 'wpSectionTitle
' );
1174 if ( $request->getCheck( 'wpSummary
' ) ) {
1175 $this->summary = $request->getText( 'wpSummary
' );
1178 $this->sectiontitle = $request->getText( 'wpSummary
' );
1181 $this->sectiontitle = null;
1182 $this->summary = $request->getText( 'wpSummary
' );
1185 # If the summary consists of a heading, e.g. '==Foobar==
', extract the title from the
1186 # header syntax, e.g. 'Foobar
'. This is mainly an issue when we are using wpSummary for
1187 # section titles. (T3600)
1188 # It is weird to modify 'sectiontitle
', even when it is provided when using the API, but API
1189 # users have come to rely on it: https://github.com/wikimedia-gadgets/twinkle/issues/1625
1190 $this->summary = preg_replace( '/^\s*=+\s*(.*?)\s*=+\s*$/
', '$1
', $this->summary );
1191 if ( $this->sectiontitle !== null ) {
1192 $this->sectiontitle = preg_replace( '/^\s*=+\s*(.*?)\s*=+\s*$/
', '$1
', $this->sectiontitle );
1195 if ( $this->section === 'new
' ) {
1196 $this->setNewSectionSummary();
1199 $this->edittime = $request->getVal( 'wpEdittime
' );
1200 $this->editRevId = $request->getIntOrNull( 'editRevId
' );
1201 $this->starttime = $request->getVal( 'wpStarttime
' );
1203 $undidRev = $request->getInt( 'wpUndidRevision
' );
1205 $this->undidRev = $undidRev;
1207 $undoAfter = $request->getInt( 'wpUndoAfter
' );
1209 $this->undoAfter = $undoAfter;
1212 $this->scrolltop = $request->getIntOrNull( 'wpScrolltop
' );
1214 if ( $this->textbox1 === '' && !$request->getCheck( 'wpTextbox1
' ) ) {
1215 // wpTextbox1 field is missing, possibly due to being "too big"
1216 // according to some filter rules that may have been configured
1217 // for security reasons.
1218 $this->incompleteForm = true;
1220 // If we receive the last parameter of the request, we can fairly
1221 // claim the POST request has not been truncated.
1222 $this->incompleteForm = !$request->getVal( 'wpUltimateParam
' );
1224 if ( $this->incompleteForm ) {
1225 # If the form is incomplete, force to preview.
1226 wfDebug( __METHOD__ . ": Form data appears to be incomplete" );
1227 wfDebug( "POST DATA: " . var_export( $request->getPostValues(), true ) );
1228 $this->preview = true;
1230 $this->preview = $request->getCheck( 'wpPreview
' );
1231 $this->diff = $request->getCheck( 'wpDiff
' );
1233 // Remember whether a save was requested, so we can indicate
1234 // if we forced preview due to session failure.
1235 $this->mTriedSave = !$this->preview;
1237 if ( $this->tokenOk( $request ) ) {
1238 # Some browsers will not report any submit button
1239 # if the user hits enter in the comment box.
1240 # The unmarked state will be assumed to be a save,
1241 # if the form seems otherwise complete.
1242 wfDebug( __METHOD__ . ": Passed token check." );
1243 } elseif ( $this->diff ) {
1244 # Failed token check, but only requested "Show Changes".
1245 wfDebug( __METHOD__ . ": Failed token check; Show Changes requested." );
1247 # Page might be a hack attempt posted from
1248 # an external site. Preview instead of saving.
1249 wfDebug( __METHOD__ . ": Failed token check; forcing preview" );
1250 $this->preview = true;
1253 $this->save = !$this->preview && !$this->diff;
1254 if ( !$this->edittime || !preg_match( '/^\d{14}$/
', $this->edittime ) ) {
1255 $this->edittime = null;
1258 if ( !$this->starttime || !preg_match( '/^\d{14}$/
', $this->starttime ) ) {
1259 $this->starttime = null;
1262 $this->recreate = $request->getCheck( 'wpRecreate
' );
1264 $this->ignoreRevisionDeletedWarning = $request->getCheck( 'wpIgnoreRevisionDeleted
' );
1266 $user = $this->context->getUser();
1268 $this->minoredit = $request->getCheck( 'wpMinoredit
' );
1269 $this->watchthis = $request->getCheck( 'wpWatchthis
' );
1270 $submittedExpiry = $request->getText( 'wpWatchlistExpiry
' );
1271 if ( $this->watchlistExpiryEnabled && $submittedExpiry !== '' ) {
1272 // This parsing of the user-posted expiry is done for both preview and saving. This
1273 // is necessary because ApiEditPage uses preview when it saves (yuck!). Note that it
1274 // only works because the unnormalized value is retrieved again below in
1275 // getCheckboxesDefinitionForWatchlist().
1276 $submittedExpiry = ExpiryDef::normalizeExpiry( $submittedExpiry, TS::ISO_8601 );
1277 if ( $submittedExpiry !== false ) {
1278 $this->watchlistExpiry = $submittedExpiry;
1282 # Don't force edit summaries when a user is editing their own user or talk page
1284 && $this->getTitle()->getText() === $user->getName()
1286 $this->allowBlankSummary =
true;
1288 $this->allowBlankSummary = $request->
getBool(
'wpIgnoreBlankSummary' )
1289 || !$this->userOptionsLookup->getOption( $user,
'forceeditsummary' );
1292 $this->autoSumm = $request->
getText(
'wpAutoSummary' );
1294 $this->allowBlankArticle = $request->
getBool(
'wpIgnoreBlankArticle' );
1295 $allowedProblematicRedirectTargetText = $request->
getText(
'wpAllowedProblematicRedirectTarget' );
1296 $this->allowedProblematicRedirectTarget = $allowedProblematicRedirectTargetText ===
''
1297 ? null : Title::newFromText( $allowedProblematicRedirectTargetText );
1298 $this->ignoreProblematicRedirects = $request->
getBool(
'wpIgnoreProblematicRedirects' );
1300 $changeTags = $request->
getVal(
'wpChangeTags' );
1301 $changeTagsAfterPreview = $request->
getVal(
'wpChangeTagsAfterPreview' );
1302 if ( $changeTags ===
null || $changeTags ===
'' ) {
1303 $this->changeTags = [];
1305 $this->changeTags = array_filter(
1308 explode(
',', $changeTags )
1312 if ( $changeTagsAfterPreview !==
null && $changeTagsAfterPreview !==
'' ) {
1313 $this->changeTags = array_merge( $this->changeTags, array_filter(
1316 explode(
',', $changeTagsAfterPreview )
1340 private function initialiseForm(): bool {
1341 $this->edittime = $this->page->getTimestamp();
1342 $this->editRevId = $this->page->getLatest();
1344 $dummy = $this->contentHandlerFactory
1345 ->getContentHandler( $this->contentModel )
1346 ->makeEmptyContent();
1347 $content = $this->getContentObject( $dummy ); # TODO: track content
object?!
1348 if ( $content === $dummy ) {
1349 $this->noSuchSectionPage();
1354 $out = $this->context->getOutput();
1356 $this->editFormPageTop .= Html::errorBox(
1357 $out->parseAsInterface( $this->context->msg(
'missing-revision-content',
1359 Message::plaintextParam( $this->getTitle()->getPrefixedText() )
1362 } elseif ( !$this->pageEditingHelper->isSupportedContentModel(
1363 $content->getModel(), $this->enableApiEditOverride,
1365 $modelMsg = $this->getContext()->msg(
'content-model-' . $content->getModel() );
1366 $modelName = $modelMsg->exists() ? $modelMsg->text() : $content->getModel();
1368 $out = $this->context->getOutput();
1369 $out->showErrorPage(
1370 'modeleditnotsupported-title',
1371 'modeleditnotsupported-text',
1377 $this->textbox1 = $this->pageEditingHelper->toEditText(
1378 $content, $this->contentFormat, $this->enableApiEditOverride
1381 $user = $this->context->getUser();
1383 # Sort out the "watch" checkbox
1384 if ( $this->userOptionsLookup->getOption( $user,
'watchdefault' ) ) {
1386 $this->watchthis =
true;
1387 } elseif ( $this->userOptionsLookup->getOption( $user,
'watchcreations' ) && !$this->page->exists() ) {
1389 $this->watchthis =
true;
1390 } elseif ( $this->watchlistManager->isWatched( $user, $this->page ) ) {
1392 $this->watchthis =
true;
1394 if ( $this->watchthis && $this->watchlistExpiryEnabled ) {
1395 $watchedItem = $this->watchedItemStore->getWatchedItem( $user, $this->getTitle() );
1396 $this->watchlistExpiry = $watchedItem ? $watchedItem->getExpiry() :
null;
1398 if ( !$this->isNew && $this->userOptionsLookup->getOption( $user,
'minordefault' ) ) {
1399 $this->minoredit =
true;
1410 $services = MediaWikiServices::getInstance();
1411 $request = $this->context->getRequest();
1416 if ( !$this->page->exists() || $this->section ===
'new' ) {
1419 $this->context->getUser(),
1420 $request->
getVal(
'preload' ),
1421 array_filter( $request->
getArray(
'preloadparams', [] ), is_string( ... ) ),
1422 $request->
getVal(
'section' )
1425 } elseif ( $this->section !==
'' ) {
1427 $orig = $this->pageEditingHelper->getOriginalContent(
1428 $this->getAuthority(),
1430 $this->contentModel,
1433 $content = $orig ? $orig->getSection( $this->section ) :
null;
1436 $content = $defaultContent;
1439 $undoafter = $request->
getInt(
'undoafter' );
1440 $undo = $request->
getInt(
'undo' );
1442 if ( $undo > 0 && $undoafter > 0 ) {
1445 $undorev = $this->revisionStore->getRevisionByTitle( $this->page, $undo );
1446 $oldrev = $this->revisionStore->getRevisionByTitle( $this->page, $undoafter );
1449 # Make sure it's the right page,
1450 # the revisions exist and they were not deleted.
1451 # Otherwise, $content will be left as-is.
1452 if ( $undorev !==
null && $oldrev !==
null &&
1453 !$undorev->isDeleted( RevisionRecord::DELETED_TEXT ) &&
1454 !$oldrev->isDeleted( RevisionRecord::DELETED_TEXT )
1456 if ( WikiPage::hasDifferencesOutsideMainSlot( $undorev, $oldrev )
1457 || !$this->pageEditingHelper->isSupportedContentModel(
1458 $oldrev->getMainContentModel(), $this->enableApiEditOverride
1462 $this->context->getOutput()->redirect( $this->getTitle()->getFullURL( [
1463 'action' =>
'mcrundo',
1465 'undoafter' => $undoafter,
1469 $content = $this->pageEditingHelper->getUndoContent( $this->page, $undorev, $oldrev, $undoMsg );
1472 if ( $undoMsg ===
null ) {
1473 $oldContent = $this->page->getContent( RevisionRecord::RAW );
1474 $parserOptions = ParserOptions::newFromUserAndLang(
1475 $this->getUserForPreview(),
1479 $newContent = $contentTransformer->preSaveTransform(
1480 $content, $this->page, $this->getUserForPreview(), $parserOptions
1483 if ( $newContent->getModel() !== $oldContent->getModel() ) {
1488 $this->contentModel = $newContent->getModel();
1489 $oldMainSlot = $oldrev->getSlot(
1493 $this->contentFormat = $oldMainSlot->getFormat();
1494 if ( $this->contentFormat ===
null ) {
1495 $this->contentFormat = $this->contentHandlerFactory
1496 ->getContentHandler( $oldMainSlot->getModel() )
1497 ->getDefaultFormat();
1501 if ( $newContent->equals( $oldContent ) ) {
1502 # Tell the user that the undo results in no change,
1503 # i.e. the revisions were already undone.
1504 $undoMsg =
'nochange';
1507 # Inform the user of our success and set an automatic edit summary
1508 $undoMsg =
'success';
1509 $this->generateUndoEditSummary( $oldrev, $undo, $undorev, $services );
1510 $this->undidRev = $undo;
1511 $this->undoAfter = $undoafter;
1512 $this->formtype =
'diff';
1522 $out = $this->context->getOutput();
1525 $class =
"mw-undo-{$undoMsg}";
1526 $html = $this->context->msg(
'undo-' . $undoMsg )->parse();
1527 if ( $undoMsg !==
'success' ) {
1528 $html = Html::errorBox( $html );
1530 $this->editFormPageTop .= Html::rawElement(
1532 [
'class' => $class ],
1537 if ( $content ===
false ) {
1538 $content = $this->pageEditingHelper->getOriginalContent(
1539 $this->getAuthority(),
1541 $this->contentModel,
1559 private function generateUndoEditSummary(
1566 $firstRev = $this->revisionStore->getNextRevision( $oldRev );
1567 if ( $firstRev && $firstRev->getId() == $undo ) {
1569 $userText = $undoRev->
getUser()?->getName();
1571 if ( $userText ===
null ) {
1572 $undoSummary = $this->context->msg(
1573 'undo-summary-username-hidden',
1575 )->inContentLanguage()->text();
1576 } elseif ( ExternalUserNames::isExternal( $userText ) ) {
1578 $userLinkTitle = ExternalUserNames::getUserLinkTitle( $userText );
1579 if ( $userLinkTitle ) {
1580 $userLink = $userLinkTitle->getPrefixedText();
1581 $undoSummary = $this->context->msg(
1582 'undo-summary-import',
1586 )->inContentLanguage()->text();
1588 $undoSummary = $this->context->msg(
1589 'undo-summary-import2',
1592 )->inContentLanguage()->text();
1597 !$undoRev->
getUser()->isRegistered();
1598 $disableAnonTalk = $services->
getMainConfig()->get( MainConfigNames::DisableAnonTalk );
1599 $undoMessage = ( $undoIsAnon && $disableAnonTalk ) ?
1600 'undo-summary-anon' :
1602 $undoSummary = $this->context->msg(
1606 )->inContentLanguage()->text();
1610 $firstRevisionId = $firstRev->getId();
1611 $lastRevisionId = $undoRev->
getId();
1613 $firstRev->getPageId(),
1617 [ RevisionStore::INCLUDE_BOTH, RevisionStore::INCLUDE_DELETED_REVISIONS ]
1619 $undoSummary = $this->context->msg(
'undo-summary-multiple' )
1620 ->numParams( $revisionCount )
1621 ->params( $firstRevisionId, $lastRevisionId )
1622 ->inContentLanguage()
1625 if ( $this->summary ===
'' ) {
1626 $this->summary = $undoSummary;
1628 $this->summary = $undoSummary . $this->context->msg(
'colon-separator' )
1629 ->inContentLanguage()->text() . $this->summary;
1644 private function getParentRevId() {
1645 if ( $this->parentRevId ) {
1646 return $this->parentRevId;
1648 return $this->mArticle->getRevIdFetched();
1661 return $this->pageEditingHelper->getCurrentContent( $this->contentModel, $this->page );
1670 private function tokenOk(
WebRequest $request ): bool {
1671 $token = $request->getVal(
'wpEditToken' );
1672 $user = $this->context->getUser();
1673 $this->mTokenOk = $user->matchEditToken( $token );
1674 return $this->mTokenOk;
1691 private function setPostEditCookie(
int $statusValue ): void {
1692 $revisionId = $this->page->getLatest();
1693 $postEditKey = self::POST_EDIT_COOKIE_KEY_PREFIX . $revisionId;
1696 if ( $statusValue === self::AS_SUCCESS_NEW_ARTICLE ) {
1698 } elseif ( $this->oldid ) {
1701 if ( $this->tempUserCreateDone ) {
1702 $val .=
'+tempuser';
1705 $response = $this->context->getRequest()->response();
1706 $response->setCookie( $postEditKey, $val, time() + self::POST_EDIT_COOKIE_DURATION );
1717 $markAsBot = $this->markAsBot
1718 && $this->getAuthority()->isAllowed(
'bot' );
1721 $markAsMinor = $this->minoredit && !$this->isNew
1722 && $this->getAuthority()->isAllowed(
'minoredit' );
1724 $status = $this->internalAttemptSave( $resultDetails, $markAsBot, $markAsMinor );
1725 if ( !$status->isOK() ) {
1726 $this->handleFailedConstraint( $status );
1731 $this->getHookRunner()->onEditPage__attemptSave_after( $this, Status::wrap( $status ), $resultDetails );
1739 private function incrementResolvedConflicts(): void {
1740 if ( $this->context->getRequest()->getText(
'mode' ) !==
'conflict' ) {
1744 $this->getEditConflictHelper()->incrementResolvedStats( $this->context->getUser() );
1756 private function handleStatus( EditPageStatus $status, $resultDetails ): bool {
1757 $statusValue = is_int( $status->value ) ? $status->value : 0;
1763 if ( $statusValue === self::AS_SUCCESS_UPDATE
1764 || $statusValue === self::AS_SUCCESS_NEW_ARTICLE
1766 $this->incrementResolvedConflicts();
1768 $this->didSave =
true;
1769 if ( !$resultDetails[
'nullEdit'] ) {
1770 $this->setPostEditCookie( $statusValue );
1774 $out = $this->context->getOutput();
1778 $request = $this->context->getRequest();
1779 $extraQueryRedirect = $request->
getVal(
'wpExtraQueryRedirect' );
1781 switch ( $statusValue ) {
1784 case self::AS_HOOK_ERROR_EXPECTED:
1785 case self::AS_CONFLICT_DETECTED:
1788 case self::AS_HOOK_ERROR:
1793 case self::AS_ARTICLE_WAS_DELETED:
1794 case self::AS_BLANK_ARTICLE:
1795 case self::AS_BROKEN_REDIRECT:
1796 case self::AS_CONTENT_TOO_BIG:
1797 case self::AS_DOUBLE_REDIRECT:
1798 case self::AS_DOUBLE_REDIRECT_LOOP:
1800 case self::AS_INVALID_REDIRECT_TARGET:
1801 case self::AS_MAX_ARTICLE_SIZE_EXCEEDED:
1802 case self::AS_PARSE_ERROR:
1803 case self::AS_RATE_LIMITED:
1804 case self::AS_REVISION_MISSING:
1805 case self::AS_REVISION_WAS_DELETED:
1806 case self::AS_SELF_REDIRECT:
1807 case self::AS_SUMMARY_NEEDED:
1808 case self::AS_TEXTBOX_EMPTY:
1809 case self::AS_UNABLE_TO_ACQUIRE_TEMP_ACCOUNT:
1810 case self::AS_UNICODE_NOT_SUPPORTED:
1811 $out->addHTML( $this->formatConstraintStatus( $status ) );
1814 case self::AS_SUCCESS_NEW_ARTICLE:
1816 if ( $resultDetails[
'redirect'] ) {
1817 $queryParts[] =
'redirect=no';
1819 if ( $extraQueryRedirect ) {
1820 $queryParts[] = $extraQueryRedirect;
1822 $anchor = $resultDetails[
'sectionanchor'] ??
'';
1823 $this->doPostEditRedirect( implode(
'&', $queryParts ), $anchor );
1826 case self::AS_SUCCESS_UPDATE:
1828 $sectionanchor = $resultDetails[
'sectionanchor'];
1830 $this->getHookRunner()->onArticleUpdateBeforeRedirect( $this->mArticle,
1831 $sectionanchor, $extraQuery );
1834 if ( $resultDetails[
'redirect'] ) {
1835 $queryParts[] =
'redirect=no';
1837 if ( $extraQuery ) {
1838 $queryParts[] = $extraQuery;
1840 if ( $extraQueryRedirect ) {
1841 $queryParts[] = $extraQueryRedirect;
1843 $this->doPostEditRedirect( implode(
'&', $queryParts ), $sectionanchor );
1846 case self::AS_SPAM_ERROR:
1847 $this->spamPageWithContent( $resultDetails[
'spam'] ??
false );
1850 case self::AS_BLOCKED_PAGE_FOR_USER:
1851 case self::AS_IMAGE_REDIRECT_ANON:
1852 case self::AS_IMAGE_REDIRECT_LOGGED:
1853 case self::AS_NO_CHANGE_CONTENT_MODEL:
1854 case self::AS_NO_CREATE_PERMISSION:
1855 case self::AS_READ_ONLY_PAGE:
1856 case self::AS_READ_ONLY_PAGE_ANON:
1857 case self::AS_READ_ONLY_PAGE_LOGGED:
1858 $status->throwError();
1866 $this->hookError = Html::errorBox(
1867 "\n" . Status::cast( $status )->getWikiText(
false,
false, $this->context->getLanguage() )
1877 private function formatConstraintStatus(
StatusValue $status ): string {
1878 return $this->createMessageBox( $status->getMessages(
'error' ),
'error' ) .
1879 $this->createMessageBox( $status->getMessages(
'warning' ),
'warning' );
1887 private function createMessageBox( array $messages,
string $type ): string {
1894 Html::openElement(
'br' ),
1895 array_map( fn ( $msg ) => $this->context->msg( $msg )->parse(), $messages )
1898 if ( $type ===
'warning' ) {
1899 return Html::warningBox( $html );
1901 return Html::errorBox( $html );
1911 private function doPostEditRedirect( $query, $anchor ) {
1912 $out = $this->context->getOutput();
1913 $url = $this->getTitle()->getFullURL( $query ) . $anchor;
1914 $user = $this->getUserForSave();
1923 $shouldRedirectForTempUser = $this->tempUserCreateDone ||
1924 ( $user->isTemp() && ( $user->getEditCount() === 0 ) );
1925 if ( $shouldRedirectForTempUser ) {
1926 $this->getHookRunner()->onTempUserCreatedRedirect(
1927 $this->context->getRequest()->getSession(),
1929 $this->getTitle()->getPrefixedDBkey(),
1935 $out->redirect(
$url );
1941 private function setNewSectionSummary(): void {
1942 Assert::precondition( $this->section ===
'new',
'This method can only be called for new sections' );
1943 Assert::precondition( $this->sectiontitle !==
null,
'This method can only be called for new sections' );
1945 $services = MediaWikiServices::getInstance();
1951 if ( $this->sectiontitle !==
'' ) {
1952 $this->newSectionAnchor = $this->pageEditingHelper->guessSectionName( $this->sectiontitle );
1956 if ( $this->summary ===
'' ) {
1957 $messageValue = MessageValue::new(
'newsectionsummary' )
1958 ->plaintextParams( $parser->stripSectionName( $this->sectiontitle ) );
1959 $this->summary = $textFormatter->format( $messageValue );
1962 $this->newSectionAnchor =
'';
1992 private function internalAttemptSave( &$result, $markAsBot =
false, $markAsMinor =
false ) {
1994 if ( $this->unableToAcquireTempName ) {
1995 return EditPageStatus::newFatal(
'temp-user-unable-to-acquire' )
1996 ->setValue( self::AS_UNABLE_TO_ACQUIRE_TEMP_ACCOUNT );
2004 $tempAccountStatus = $this->createTempUser();
2005 if ( !$tempAccountStatus->isOK() ) {
2006 return EditPageStatus::cast( $tempAccountStatus );
2008 if ( $tempAccountStatus instanceof CreateStatus ) {
2009 $result[
'savedTempUser'] = $tempAccountStatus->getUser();
2012 $useNPPatrol = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::UseNPPatrol );
2013 $useRCPatrol = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::UseRCPatrol );
2014 if ( !$this->getHookRunner()->onEditPage__attemptSave( $this ) ) {
2015 wfDebug(
"Hook 'EditPage::attemptSave' aborted article saving" );
2016 return EditPageStatus::newFatal(
'hookaborted' )
2017 ->setValue( self::AS_HOOK_ERROR );
2020 if ( !$this->getHookRunner()->onEditFilter( $this, $this->textbox1, $this->section,
2021 $this->hookError, $this->summary )
2023 # Error messages etc. could be handled within the hook...
2024 return EditPageStatus::newFatal(
'hookaborted' )
2025 ->setValue( self::AS_HOOK_ERROR );
2026 } elseif ( $this->hookError ) {
2027 # ...or the hook could be expecting us to produce an error
2028 return EditPageStatus::newFatal(
'hookaborted' )
2029 ->setValue( self::AS_HOOK_ERROR_EXPECTED );
2033 # Construct Content object
2034 $textbox_content = $this->toEditContent( $this->textbox1 );
2035 }
catch ( MWContentSerializationException $ex ) {
2036 return EditPageStatus::newFatal(
2037 'content-failed-to-parse',
2038 $this->contentModel,
2039 $this->contentFormat,
2041 )->setValue( self::AS_PARSE_ERROR );
2043 '@phan-var Content $textbox_content';
2045 $this->contentLength = strlen( $this->textbox1 );
2047 $requestUser = $this->context->getUser();
2049 $pstUser = $this->getUserForPreview();
2051 $changingContentModel =
false;
2052 if ( $this->contentModel !== $this->getTitle()->getContentModel() ) {
2053 $changingContentModel =
true;
2054 $oldContentModel = $this->getTitle()->getContentModel();
2059 $this->page->loadPageData( IDBAccessObject::READ_LATEST );
2060 $new = !$this->page->exists();
2063 $submitButtonLabel = $this->getSubmitButtonLabel();
2065 $preliminaryChecksRunner = $this->getPreliminaryChecksRunner(
2072 $status = $preliminaryChecksRunner->checkConstraints();
2073 if ( !$status->isOK() ) {
2074 $failed = $status->getFailedConstraint();
2078 if ( $failed instanceof SpamRegexConstraint ) {
2079 $result[
'spam'] = $failed->getMatch();
2091 $content = $textbox_content;
2093 $result[
'sectionanchor'] =
'';
2094 if ( $this->section ===
'new' ) {
2095 if ( $this->sectiontitle !==
null ) {
2097 $content = $content->addSectionHeader( $this->sectiontitle );
2099 $result[
'sectionanchor'] = $this->newSectionAnchor;
2102 $pageUpdater = $this->page->newPageUpdater( $pstUser )
2103 ->setContent( SlotRecord::MAIN, $content );
2104 $pageUpdater->prepareUpdate( $flags );
2106 $newPageChecksRunner = $this->getNewPageChecksRunner(
2112 $status = $newPageChecksRunner->checkConstraints();
2113 if ( !$status->isOK() ) {
2118 # Article exists. Check for edit conflict.
2120 $timestamp = $this->page->getTimestamp();
2121 $latest = $this->page->getLatest();
2123 wfDebug(
"timestamp: {$timestamp}, edittime: {$this->edittime}" );
2124 wfDebug(
"revision: {$latest}, editRevId: {$this->editRevId}" );
2126 $editConflictLogger = LoggerFactory::getInstance(
'EditConflict' );
2131 if ( ( $this->edittime !==
null && $this->edittime != $timestamp )
2132 || ( $this->editRevId !==
null && $this->editRevId != $latest )
2134 $this->isConflict =
true;
2135 if ( $this->section ===
'new' ) {
2136 if ( $this->page->getUserText() === $requestUser->getName() &&
2137 $this->page->getComment() === $this->summary
2142 $editConflictLogger->debug(
2143 'Duplicate new section submission; trigger edit conflict!'
2147 $this->isConflict =
false;
2148 $editConflictLogger->debug(
'Conflict suppressed; new section' );
2150 } elseif ( $this->section ===
''
2152 && $this->revisionStore->userWasLastToEdit(
2153 $this->dbProvider->getPrimaryDatabase(),
2154 $this->getTitle()->getArticleID(),
2155 $requestUser->getId(),
2159 # Suppress edit conflict with self, except for section edits where merging is required.
2160 $editConflictLogger->debug(
'Suppressing edit conflict, same user.' );
2161 $this->isConflict =
false;
2165 if ( $this->isConflict ) {
2166 $editConflictLogger->debug(
2167 'Conflict! Getting section {section} for time {editTime}'
2168 .
' (id {editRevId}, article time {timestamp})',
2170 'section' => $this->section,
2171 'editTime' => $this->edittime,
2172 'editRevId' => $this->editRevId,
2173 'timestamp' => $timestamp,
2178 if ( $this->editRevId !==
null ) {
2179 $content = $this->page->replaceSectionAtRev(
2182 $this->sectiontitle,
2186 $content = $this->page->replaceSectionContent(
2189 $this->sectiontitle,
2194 $editConflictLogger->debug(
2195 'Getting section {section}',
2196 [
'section' => $this->section ]
2198 $content = $this->page->replaceSectionAtRev(
2205 if ( $content ===
null ) {
2206 $editConflictLogger->debug(
'Activating conflict; section replace failed.' );
2207 $this->isConflict =
true;
2208 $content = $textbox_content;
2209 } elseif ( $this->isConflict ) {
2211 $mergedChange = $this->mergeChangesIntoContent( $content );
2212 if ( $mergedChange !==
false ) {
2214 $content = $mergedChange[0];
2215 $this->parentRevId = $mergedChange[1];
2216 $this->isConflict =
false;
2217 $editConflictLogger->debug(
'Suppressing edit conflict, successful merge.' );
2219 $this->section =
'';
2220 $this->textbox1 = ( $content instanceof TextContent ) ? $content->getText() :
'';
2221 $editConflictLogger->debug(
'Keeping edit conflict, failed merge.' );
2225 if ( $this->isConflict ) {
2226 return EditPageStatus::newGood( self::AS_CONFLICT_DETECTED )->setOK(
false );
2229 $pageUpdater = $this->page->newPageUpdater( $pstUser )
2230 ->setContent( SlotRecord::MAIN, $content );
2231 $pageUpdater->prepareUpdate( $flags );
2233 $existingPageChecksRunner = $this->getExistingPageChecksRunner(
2240 $status = $existingPageChecksRunner->checkConstraints();
2241 if ( !$status->isOK() ) {
2246 $sectionAnchor =
'';
2247 if ( $this->section ===
'new' ) {
2248 $sectionAnchor = $this->newSectionAnchor;
2249 } elseif ( $this->section !==
'' ) {
2250 # Try to get a section anchor from the section source, redirect
2251 # to edited section if header found.
2252 # XXX: Might be better to integrate this into WikiPage::replaceSectionAtRev
2253 # for duplicate heading checking and maybe parsing.
2254 $hasmatch = preg_match(
"/^ *([=]{1,6})(.*?)(\\1) *\\n/i", $this->textbox1,
$matches );
2255 # We can't deal with anchors, includes, html etc in the header for now,
2256 # headline would need to be parsed to improve this.
2257 if ( $hasmatch &&
$matches[2] !==
'' ) {
2258 $sectionAnchor = $this->pageEditingHelper->guessSectionName(
$matches[2] );
2261 $result[
'sectionanchor'] = $sectionAnchor;
2267 $this->textbox1 = $this->pageEditingHelper->toEditText(
2268 $content, $this->contentFormat, $this->enableApiEditOverride
2270 $this->section =
'';
2274 $this->contentLength = strlen( $this->pageEditingHelper->toEditText(
2275 $content, $this->contentFormat, $this->enableApiEditOverride
2278 $postMergeChecksRunner = $this->getPostMergeChecksRunner(
2282 $status = $postMergeChecksRunner->checkConstraints();
2283 if ( !$status->isOK() ) {
2287 if ( $this->undidRev && $this->isUndoClean( $content ) ) {
2292 ->setOriginalRevisionId( $this->undoAfter ?: false )
2293 ->setCause( PageUpdateCauses::CAUSE_UNDO )
2295 EditResult::REVERT_UNDO,
2297 $this->undoAfter ?: null
2301 $needsPatrol = $useRCPatrol || ( $useNPPatrol && !$this->page->exists() );
2302 if ( $needsPatrol && $authority->authorizeWrite(
'autopatrol', $this->getTitle() ) ) {
2303 $pageUpdater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED );
2307 ->addTags( $this->changeTags )
2309 CommentStoreComment::newUnsavedComment( trim( $this->summary ) ),
2312 $doEditStatus = $pageUpdater->getStatus();
2314 if ( !$doEditStatus->isOK() ) {
2319 $doEditStatus->failedBecausePageMissing() ||
2320 $doEditStatus->failedBecausePageExists() ||
2321 $doEditStatus->failedBecauseOfConflict()
2323 $this->isConflict =
true;
2324 return EditPageStatus::cast( $doEditStatus )
2325 ->setValue( self::AS_END );
2327 return EditPageStatus::cast( $doEditStatus );
2330 $result[
'nullEdit'] = !$doEditStatus->wasRevisionCreated();
2331 if ( $result[
'nullEdit'] ) {
2333 $limitSubject = $requestUser->toRateLimitSubject();
2334 MediaWikiServices::getInstance()->getRateLimiter()->limit( $limitSubject,
'linkpurge' );
2336 $result[
'redirect'] = $content->isRedirect();
2338 $this->updateWatchlist();
2341 if ( $changingContentModel ) {
2342 $this->addContentModelChangeLogEntry(
2343 $this->getUserForSave(),
2346 $new ?
false : $oldContentModel,
2347 $this->contentModel,
2355 $statusCode = ( $new ? self::AS_SUCCESS_NEW_ARTICLE : self::AS_SUCCESS_UPDATE );
2356 return EditPageStatus::newGood( $statusCode );
2359 private function getPreliminaryChecksRunner(
2360 Authority $authority,
2362 Content $newContent,
2364 string $submitButtonLabel,
2365 ): EditConstraintRunner {
2366 return new EditConstraintRunner(
2368 new UnicodeConstraint( $this->unicodeCheck ),
2372 $this->constraintFactory->newSimpleAntiSpamConstraint(
2373 $this->context->
getRequest()->getText(
'wpAntispam' ),
2379 $this->constraintFactory->newSpamRegexConstraint(
2381 $this->sectiontitle,
2387 new ImageRedirectConstraint(
2393 $this->constraintFactory->newReadOnlyConstraint(),
2395 new AuthorizationConstraint(
2401 new ContentModelChangeConstraint(
2407 $this->constraintFactory->newLinkPurgeRateLimitConstraint( $requestUser->toRateLimitSubject() ),
2411 $this->constraintFactory->newPageSizeConstraint(
2412 $this->contentLength,
2413 PageSizeConstraint::BEFORE_MERGE
2416 new ChangeTagsConstraint( $authority, $this->changeTags ),
2419 $this->constraintFactory->newAccidentalRecreationConstraint(
2428 private function getNewPageChecksRunner(
2432 string $submitButtonLabel,
2433 ): EditConstraintRunner {
2434 return new EditConstraintRunner(
2438 new DefaultTextConstraint(
2440 $this->allowBlankArticle,
2445 $this->constraintFactory->newEditFilterMergedContentHookConstraint(
2450 $this->context->getLanguage(),
2456 private function getExistingPageChecksRunner(
2457 Authority $authority,
2461 string $submitButtonLabel,
2462 ): EditConstraintRunner {
2463 return new EditConstraintRunner(
2464 $this->constraintFactory->newEditFilterMergedContentHookConstraint(
2469 $this->context->getLanguage(),
2472 new NewSectionMissingSubjectConstraint(
2474 $this->sectiontitle ??
'',
2475 $this->allowBlankSummary,
2478 new MissingCommentConstraint( $this->section, $this->textbox1 ),
2479 new ExistingSectionEditConstraint(
2483 $this->allowBlankSummary,
2485 $this->pageEditingHelper->getOriginalContent(
2488 $this->contentModel,
2493 new RevisionDeletedConstraint(
2495 $this->ignoreRevisionDeletedWarning,
2501 'edit-constraint-warning-wrapper-save-deleted-revision',
2502 [ MessageValue::new( $submitButtonLabel ) ],
2508 private function getPostMergeChecksRunner(
2510 string $submitButtonLabel,
2511 ): EditConstraintRunner {
2512 $constraintRunner = new EditConstraintRunner();
2513 if ( !$this->ignoreProblematicRedirects ) {
2514 $constraintRunner->addConstraint(
2515 $this->constraintFactory->newRedirectConstraint(
2516 $this->allowedProblematicRedirectTarget,
2518 $this->getCurrentContent(),
2521 'edit-constraint-warning-wrapper-save',
2522 [ MessageValue::new( $submitButtonLabel ) ],
2524 $this->contentFormat,
2528 $constraintRunner->addConstraint(
2531 $this->constraintFactory->newPageSizeConstraint(
2532 $this->contentLength,
2533 PageSizeConstraint::AFTER_MERGE
2536 return $constraintRunner;
2545 private function handleFailedConstraint( EditPageStatus $status ): void {
2546 $failed = $status->getFailedConstraint();
2547 if ( $failed instanceof AuthorizationConstraint ) {
2550 !MediaWikiServices::getInstance()->getReadOnlyMode()->isReadOnly()
2551 && $status->value === self::AS_BLOCKED_PAGE_FOR_USER
2553 $this->context->getUser()->spreadAnyEditBlock();
2555 } elseif ( $failed instanceof DefaultTextConstraint ) {
2556 $this->blankArticle =
true;
2557 } elseif ( $failed instanceof EditFilterMergedContentHookConstraint ) {
2558 $this->hookError = $failed->getHookError();
2563 $failed instanceof ExistingSectionEditConstraint
2564 && $status->value === self::AS_SUMMARY_NEEDED
2566 $failed instanceof NewSectionMissingSubjectConstraint
2568 $this->missingSummary =
true;
2569 } elseif ( $failed instanceof RedirectConstraint ) {
2570 $this->problematicRedirectTarget = $failed->problematicTarget;
2571 } elseif ( $failed instanceof AccidentalRecreationConstraint ) {
2572 $this->recreate =
true;
2573 } elseif ( $failed instanceof RevisionDeletedConstraint ) {
2574 $this->ignoreRevisionDeletedWarning =
true;
2588 private function isUndoClean( Content $content ): bool {
2591 $undoRev = $this->revisionStore->getRevisionById( $this->undidRev );
2592 if ( $undoRev ===
null ) {
2596 if ( $this->undoAfter ) {
2597 $oldRev = $this->revisionStore->getRevisionById( $this->undoAfter );
2599 $oldRev = $this->revisionStore->getPreviousRevision( $undoRev );
2602 if ( $oldRev ===
null ||
2603 $undoRev->
isDeleted( RevisionRecord::DELETED_TEXT ) ||
2604 $oldRev->
isDeleted( RevisionRecord::DELETED_TEXT )
2609 $undoContent = $this->pageEditingHelper->getUndoContent( $this->page, $undoRev, $oldRev, $undoError );
2610 if ( !$undoContent ) {
2615 $services = MediaWikiServices::getInstance();
2617 $user = $this->getUserForPreview();
2618 $parserOptions = ParserOptions::newFromUserAndLang( $user, $contentLanguage );
2620 $undoContent = $contentTransformer->preSaveTransform( $undoContent, $this->page, $user, $parserOptions );
2622 if ( $undoContent->equals( $content ) ) {
2634 private function addContentModelChangeLogEntry( UserIdentity $user, $oldModel, $newModel, $reason =
"" ): void {
2635 $new = $oldModel === false;
2636 $log =
new ManualLogEntry(
'contentmodel', $new ?
'new' :
'change' );
2637 $log->setPerformer( $user );
2638 $log->setTarget( $this->page );
2639 $log->setComment( is_string( $reason ) ? $reason :
"" );
2640 $log->setParameters( [
2641 '4::oldmodel' => $oldModel,
2642 '5::newmodel' => $newModel
2644 $logid = $log->insert();
2645 $log->publish( $logid );
2651 private function updateWatchlist(): void {
2652 if ( $this->tempUserCreateActive ) {
2655 $user = $this->getUserForSave();
2656 if ( !$user->isNamed() ) {
2660 $watch = $this->watchthis;
2661 $watchlistExpiry = $this->watchlistExpiry;
2666 $this->watchlistManager->setWatch( $watch, $user, $this->page, $watchlistExpiry );
2668 $this->watchedItemStore->maybeEnqueueWatchlistExpiryJob();
2681 private function mergeChangesIntoContent( Content $editContent ) {
2684 $baseRevRecord = $this->getExpectedParentRevision();
2685 $baseContent = $baseRevRecord ?
2686 $baseRevRecord->getContent( SlotRecord::MAIN ) :
2689 if ( $baseContent ===
null ) {
2691 } elseif ( $baseRevRecord->isCurrent() ) {
2694 return [ $editContent, $baseRevRecord->getId() ];
2698 $currentRevisionRecord = $this->revisionStore->getRevisionByTitle(
2701 IDBAccessObject::READ_LATEST
2703 $currentContent = $currentRevisionRecord
2704 ? $currentRevisionRecord->getContent( SlotRecord::MAIN )
2707 if ( $currentContent ===
null ) {
2711 $mergedContent = $this->contentHandlerFactory
2712 ->getContentHandler( $baseContent->getModel() )
2713 ->merge3( $baseContent, $editContent, $currentContent );
2715 if ( $mergedContent ) {
2717 return [ $mergedContent, $currentRevisionRecord->getId() ];
2731 return $this->pageEditingHelper->getExpectedParentRevision(
2739 $out = $this->context->getOutput();
2741 $out->addModules(
'mediawiki.action.edit' );
2742 $out->addModuleStyles( [
2743 'mediawiki.action.edit.styles',
2744 'mediawiki.codex.messagebox.styles',
2745 'mediawiki.editfont.styles',
2746 'mediawiki.interface.helpers.styles',
2749 $user = $this->context->getUser();
2751 if ( $this->userOptionsLookup->getOption( $user,
'uselivepreview' ) ) {
2752 $out->addModules(
'mediawiki.action.edit.preview' );
2755 if ( $this->userOptionsLookup->getOption( $user,
'useeditwarning' ) ) {
2756 $out->addModules(
'mediawiki.action.edit.editWarning' );
2759 if ( $this->context->getConfig()->get( MainConfigNames::EnableEditRecovery )
2760 && $this->userOptionsLookup->getOption( $user,
'editrecovery' )
2762 $wasPosted = $this->getContext()->getRequest()->getMethod() ===
'POST';
2763 $out->addJsConfigVars(
'wgEditRecoveryWasPosted', $wasPosted );
2764 $out->addModules(
'mediawiki.editRecovery.edit' );
2767 # Enabled article-related sidebar, toplinks, etc.
2768 $out->setArticleRelated(
true );
2770 $contextTitle = $this->getContextTitle();
2771 if ( $this->isConflict ) {
2772 $msg =
'editconflict';
2773 } elseif ( $contextTitle->exists() && $this->section !=
'' ) {
2774 $msg = $this->section ===
'new' ?
'editingcomment' :
'editingsection';
2776 $msg = $contextTitle->exists()
2778 && $contextTitle->getDefaultMessageText() !== false
2784 # Use the title defined by DISPLAYTITLE magic word when present
2785 # NOTE: getDisplayTitle() returns HTML while getPrefixedText() returns plain text.
2786 # Escape ::getPrefixedText() so that we have HTML in all cases,
2787 # and pass as a "raw" parameter to ::setPageTitleMsg().
2788 $displayTitle = $this->mParserOutput ? $this->mParserOutput->getDisplayTitle() :
false;
2789 if ( $displayTitle ===
false ) {
2790 $displayTitle = htmlspecialchars(
2791 $contextTitle->getPrefixedText(), ENT_QUOTES,
'UTF-8',
false
2794 $out->setDisplayTitle( $displayTitle );
2799 $displayTitle = Html::rawElement(
'span', [
'id' =>
'firstHeadingTitle' ], $displayTitle );
2801 $out->setPageTitleMsg( $this->context->msg( $msg )->rawParams( $displayTitle ) );
2803 $config = $this->context->getConfig();
2805 # Transmit the name of the message to JavaScript. This was added for live preview.
2806 # Live preview doesn't use this anymore. The variable is still transmitted because
2807 # Edit Recovery and user scripts use it.
2808 $out->addJsConfigVars( [
2809 'wgEditMessage' => $msg,
2814 $out->addJsConfigVars(
2815 'wgEditSubmitButtonLabelPublish',
2816 $config->get( MainConfigNames::EditSubmitButtonLabelPublish )
2823 private function showIntro(): void {
2832 $skip = $this->suppressIntro ? [
2834 'code-editing-intro',
2835 'sharedupload-desc-create',
2836 'sharedupload-desc-edit',
2837 'userpage-userdoesnotexist',
2838 'blocked-notice-logextract',
2840 'newarticletextanon',
2841 'recreate-moveddeleted-warn',
2845 IntroMessageBuilder::MORE_FRAMES,
2849 $this->mArticle->fetchRevisionRecord(),
2850 $this->context->getUser(),
2851 $this->context->getRequest()->getVal(
'editintro' ),
2854 $this->context->getRequest()->getQueryValues(),
2855 [
'title' =>
true,
'returnto' =>
true,
'returntoquery' =>
true ]
2859 $this->section !==
'' ? $this->section : null
2862 foreach ( $messages as $message ) {
2863 $this->context->getOutput()->addHTML( $message );
2884 if ( $text ===
false || $text ===
null ) {
2888 $content = ContentHandler::makeContent( $text, $this->getTitle(),
2889 $this->contentModel, $this->contentFormat );
2891 if ( !$this->pageEditingHelper->isSupportedContentModel(
2892 $content->getModel(), $this->enableApiEditOverride
2894 throw new MWException(
'This content model is not supported: ' . $content->getModel() );
2904 # need to parse the preview early so that we know which templates are used,
2905 # otherwise users with "show preview after edit box" will get a blank list
2906 # we parse this near the beginning so that setHeaders can do the title
2907 # setting work instead of leaving it in getPreviewText
2908 $previewOutput =
'';
2909 if ( $this->formtype ===
'preview' ) {
2910 $previewOutput = $this->getPreviewText();
2913 $out = $this->context->getOutput();
2916 $this->getHookRunner()->onEditPage__showEditForm_initial( $this, $out );
2918 $this->setHeaders();
2923 if ( !$this->isConflict &&
2924 $this->section !==
'' &&
2925 !$this->isSectionEditSupported()
2930 $out->showErrorPage(
'sectioneditnotsupported-title',
'sectioneditnotsupported-text' );
2934 $this->showHeader();
2936 $out->addHTML( $this->editFormPageTop );
2938 $user = $this->context->getUser();
2939 if ( $this->userOptionsLookup->getOption( $user,
'previewontop' ) ) {
2940 $this->displayPreviewArea( $previewOutput,
true );
2943 $out->addHTML( $this->editFormTextTop );
2947 $out->addHTML( Html::openElement(
2950 'class' =>
'mw-editform',
2951 'id' => self::EDITFORM_ID,
2952 'name' => self::EDITFORM_ID,
2954 'action' => $this->getActionURL( $this->getContextTitle() ),
2955 'enctype' =>
'multipart/form-data',
2956 'data-mw-editform-type' => $this->formtype
2961 $out->addHTML( Html::hidden(
'wpUnicodeCheck', self::UNICODE_CHECK ) );
2965 Html::openElement(
'div', [
'id' =>
'antispam-container',
'style' =>
'display: none;' ] )
2968 [
'for' =>
'wpAntispam' ],
2969 $this->context->msg(
'simpleantispam-label' )->parse()
2975 'name' =>
'wpAntispam',
2976 'id' =>
'wpAntispam',
2980 . Html::closeElement(
'div' )
2983 $this->getHookRunner()->onEditPage__showEditForm_fields( $this, $out );
2986 $this->showFormBeforeText();
2988 # When the summary is hidden, also hide them on preview/show changes
2989 if ( $this->nosummary ) {
2990 $out->addHTML( Html::hidden(
'nosummary',
true ) );
2993 # If a blank edit summary was previously provided, and the appropriate
2994 # user preference is active, pass a hidden tag as wpIgnoreBlankSummary. This will stop the
2995 # user being bounced back more than once in the event that a summary
2998 # For a bit more sophisticated detection of blank summaries, hash the
2999 # automatic one and pass that in the hidden field wpAutoSummary.
3001 $this->missingSummary ||
3002 ( $this->section ===
'new' && $this->nosummary ) ||
3003 $this->allowBlankSummary
3005 $out->addHTML( Html::hidden(
'wpIgnoreBlankSummary',
true ) );
3008 if ( $this->undidRev ) {
3009 $out->addHTML( Html::hidden(
'wpUndidRevision', $this->undidRev ) );
3011 if ( $this->undoAfter ) {
3012 $out->addHTML( Html::hidden(
'wpUndoAfter', $this->undoAfter ) );
3014 if ( $this->recreate ) {
3015 $out->addHTML( Html::hidden(
'wpRecreate', $this->recreate ) );
3017 if ( $this->ignoreRevisionDeletedWarning ) {
3018 $out->addHTML( Html::hidden(
'wpIgnoreRevisionDeleted', $this->ignoreRevisionDeletedWarning ) );
3021 if ( $this->problematicRedirectTarget !==
null ) {
3024 $out->addHTML( Html::hidden(
3025 'wpAllowedProblematicRedirectTarget',
3026 $this->problematicRedirectTarget->getFullText()
3030 $autosumm = $this->autoSumm !==
'' ? $this->autoSumm : md5( $this->summary );
3031 $out->addHTML( Html::hidden(
'wpAutoSummary', $autosumm ) );
3033 $out->addHTML( Html::hidden(
'oldid', $this->oldid ) );
3034 $out->addHTML( Html::hidden(
'parentRevId', $this->getParentRevId() ) );
3036 $out->addHTML( Html::hidden(
'format', $this->contentFormat ) );
3037 $out->addHTML( Html::hidden(
'model', $this->contentModel ) );
3038 if ( $this->changeTags ) {
3039 $out->addHTML( Html::hidden(
'wpChangeTagsAfterPreview', implode(
',', $this->changeTags ) ) );
3044 if ( $this->section ===
'new' ) {
3045 $this->showSummaryInput(
true );
3046 $out->addHTML( $this->getSummaryPreview(
true ) );
3049 $out->addHTML( $this->editFormTextBeforeContent );
3050 if ( $this->isConflict ) {
3051 $currentText = $this->pageEditingHelper->toEditText(
3052 $this->getCurrentContent(), $this->contentFormat, $this->enableApiEditOverride
3055 $editConflictHelper = $this->getEditConflictHelper();
3056 $editConflictHelper->
setTextboxes( $this->textbox1, $currentText );
3061 $this->textbox2 = $this->textbox1;
3062 $this->textbox1 = $currentText;
3065 if ( !$this->getTitle()->isUserConfigPage() ) {
3066 $out->addHTML( self::getEditToolbar() );
3069 if ( $this->blankArticle ) {
3070 $out->addHTML( Html::hidden(
'wpIgnoreBlankArticle',
true ) );
3073 if ( $this->isConflict ) {
3078 $conflictTextBoxAttribs = [];
3079 if ( $this->isOldRev ) {
3080 $conflictTextBoxAttribs[
'class'] =
'mw-textarea-oldrev';
3090 $this->showContentForm();
3093 $out->addHTML( $this->editFormTextAfterContent );
3095 $this->showStandardInputs();
3097 $this->showFormAfterText();
3099 $this->showTosSummary();
3101 $this->showEditTools();
3103 $out->addHTML( $this->editFormTextAfterTools .
"\n" );
3105 $out->addHTML( $this->makeTemplatesOnThisPageList( $this->getTemplates() ) );
3107 $out->addHTML( Html::rawElement(
'div', [
'class' =>
'hiddencats' ],
3108 Linker::formatHiddenCategories( $this->page->getHiddenCategories() ) ) );
3110 $out->addHTML( Html::rawElement(
'div', [
'class' =>
'limitreport' ],
3111 self::getPreviewLimitReport( $this->mParserOutput ) ) );
3113 $out->addModules(
'mediawiki.action.edit.collapsibleFooter' );
3115 if ( $this->isConflict ) {
3117 $this->showConflict();
3120 $out->addHTML( Html::errorBox(
3121 $this->context->msg(
3122 'content-failed-to-parse',
3123 $this->contentModel,
3124 $this->contentFormat,
3132 if ( $this->isConflict ) {
3134 } elseif ( $this->preview ) {
3136 } elseif ( $this->diff ) {
3141 $out->addHTML( Html::hidden(
'mode', $mode, [
'id' =>
'mw-edit-mode' ] ) );
3145 $out->addHTML( Html::hidden(
'wpUltimateParam',
true ) );
3146 $out->addHTML( $this->editFormTextBottom .
"\n</form>\n" );
3148 if ( !$this->userOptionsLookup->getOption( $user,
'previewontop' ) ) {
3149 $this->displayPreviewArea( $previewOutput,
false );
3163 $this->linkRenderer,
3164 $this->linkBatchFactory,
3165 $this->restrictionStore
3170 if ( $this->preview ) {
3172 } elseif ( $this->section !==
'' ) {
3176 return Html::rawElement(
'div', [
'class' =>
'templatesUsed' ],
3177 $templateListFormatter->format( $templates, $type )
3187 private static function extractSectionTitle( $text ) {
3188 if ( preg_match(
"/^(=+)(.+)\\1\\s*(\n|$)/i", $text,
$matches ) ) {
3189 return MediaWikiServices::getInstance()->getParser()
3190 ->stripSectionName( trim(
$matches[2] ) );
3196 private function showHeader(): void {
3198 if ( $this->isConflict ) {
3199 $this->addExplainConflictHeader();
3200 $this->editRevId = $this->page->getLatest();
3202 if ( $this->section !==
'' && $this->section !==
'new' && $this->summary ===
'' &&
3203 !$this->preview && !$this->diff
3205 $sectionTitle = self::extractSectionTitle( $this->textbox1 );
3206 if ( $sectionTitle !==
false && $sectionTitle !==
'' ) {
3207 $this->summary =
"/* $sectionTitle */ ";
3211 if ( $this->hookError !==
'' ) {
3212 $out->addWikiTextAsInterface( $this->hookError );
3215 if ( $this->section !=
'new' ) {
3216 $revRecord = $this->mArticle->fetchRevisionRecord();
3217 if ( $revRecord instanceof RevisionStoreRecord && !$revRecord->isCurrent() ) {
3218 $this->mArticle->setOldSubtitle( $revRecord->getId() );
3219 $this->isOldRev =
true;
3224 if ( $this->formtype !==
'save' ) {
3226 $constraintFactory = MediaWikiServices::getInstance()->getService(
'_EditConstraintFactory' );
3227 $constraintRunner =
new EditConstraintRunner(
3234 new RevisionDeletedConstraint(
3240 $this->context->getUser(),
3245 $out->addHTML( $this->formatConstraintStatus( $constraintRunner->checkAllConstraints() ) );
3248 $this->addLongPageWarningHeader();
3258 private function getSummaryInputAttributes( array $inputAttrs ): array {
3263 'id' =>
'wpSummary',
3264 'name' =>
'wpSummary',
3265 'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT,
3268 'spellcheck' =>
'true',
3281 private function getSummaryInputWidget( $summary,
string $labelText, array $inputAttrs ): FieldLayout {
3282 $inputAttrs = OOUI\Element::configFromHtmlAttributes(
3283 $this->getSummaryInputAttributes( $inputAttrs )
3286 'title' => Linker::titleAttrib(
'summary' ),
3287 'accessKey' => Linker::accesskey(
'summary' ),
3291 $inputAttrs[
'inputId'] = $inputAttrs[
'id'];
3292 $inputAttrs[
'id'] =
'wpSummaryWidget';
3294 return new OOUI\FieldLayout(
3295 new OOUI\TextInputWidget( [
3296 'value' => $summary,
3297 'infusable' =>
true,
3300 'label' =>
new OOUI\HtmlSnippet( $labelText ),
3302 'id' =>
'wpSummaryLabel',
3303 'classes' => [ $this->missingSummary ?
'mw-summarymissed' :
'mw-summary' ],
3313 private function showSummaryInput(
bool $isSubjectPreview ): void {
3314 # Add a class
if 'missingsummary' is triggered to allow styling of the summary line
3315 $summaryClass = $this->missingSummary ?
'mw-summarymissed' :
'mw-summary';
3316 if ( $isSubjectPreview ) {
3317 if ( $this->nosummary ) {
3320 } elseif ( !$this->mShowSummaryField ) {
3324 $labelText = $this->context->msg( $isSubjectPreview ?
'subject' :
'summary' )->parse();
3325 $this->context->getOutput()->addHTML(
3326 $this->getSummaryInputWidget(
3327 $isSubjectPreview ? $this->sectiontitle : $this->summary,
3329 [
'class' => $summaryClass ]
3340 private function getSummaryPreview(
bool $isSubjectPreview ): string {
3342 $summary = trim( $this->summary );
3343 if ( $summary ===
'' || ( !$this->preview && !$this->diff ) ) {
3347 $commentFormatter = MediaWikiServices::getInstance()->getCommentFormatter();
3348 $summary = $this->context->msg(
'summary-preview' )->parse()
3349 . $commentFormatter->formatBlock( $summary, $this->getTitle(), $isSubjectPreview );
3350 return Html::rawElement(
'div', [
'class' =>
'mw-summary-preview' ], $summary );
3353 private function showFormBeforeText(): void {
3355 $out->addHTML( Html::hidden(
'wpSection', $this->section ) );
3356 $out->addHTML( Html::hidden(
'wpStarttime', $this->starttime ) );
3357 $out->addHTML( Html::hidden(
'wpEdittime', $this->edittime ) );
3358 $out->addHTML( Html::hidden(
'editRevId', $this->editRevId ) );
3359 $out->addHTML( Html::hidden(
'wpScrolltop', $this->scrolltop, [
'id' =>
'wpScrolltop' ] ) );
3375 $this->context->getOutput()->addHTML(
3377 Html::hidden(
"wpEditToken", $this->context->getUser()->getEditToken() ) .
3391 $this->showTextbox1();
3394 private function showTextbox1(): void {
3398 # Is an old revision being edited?
3399 if ( $this->isOldRev ) {
3400 $classes[] =
'mw-textarea-oldrev';
3404 'aria-label' => $this->context->msg(
'edit-textarea-aria-label' )->text(),
3406 'class' => $classes,
3416 protected function showTextbox(
string $text,
string $name, array $customAttribs = [] ) {
3418 $attribs = $builder->buildTextboxAttribs(
3421 $this->context->getUser(),
3425 $this->context->getOutput()->addHTML(
3426 Html::textarea( $name, $builder->addNewLineAtEnd( $text ), $attribs )
3430 private function displayPreviewArea(
string $previewOutput,
bool $isOnTop ): void {
3431 $attribs = [
'id' =>
'wikiPreview' ];
3433 $attribs[
'class'] =
'ontop';
3435 if ( $this->formtype !==
'preview' ) {
3436 $attribs[
'style'] =
'display: none;';
3439 $out = $this->context->getOutput();
3440 $out->addHTML( Html::openElement(
'div', $attribs ) );
3442 if ( $this->formtype ===
'preview' ) {
3443 $this->showPreview( $previewOutput );
3446 $out->addHTML(
'</div>' );
3448 if ( $this->formtype ===
'diff' ) {
3451 }
catch ( MWContentSerializationException $ex ) {
3452 $out->addHTML( Html::errorBox(
3453 $this->context->msg(
3454 'content-failed-to-parse',
3455 $this->contentModel,
3456 $this->contentFormat,
3470 private function showPreview(
string $text ): void {
3471 if ( $this->mArticle instanceof CategoryPage ) {
3472 $this->mArticle->openShowCategory();
3474 # This hook seems slightly odd here, but makes things more
3475 # consistent for extensions.
3476 $out = $this->context->getOutput();
3477 $this->getHookRunner()->onOutputPageBeforeHTML( $out, $text );
3478 $out->addHTML( $text );
3479 if ( $this->mArticle instanceof CategoryPage ) {
3480 $this->mArticle->closeShowCategory();
3492 $oldtitlemsg =
'currentrev';
3493 # if message does not exist, show diff against the preloaded default
3494 if ( $this->page->getNamespace() ===
NS_MEDIAWIKI && !$this->page->exists() ) {
3495 $oldtext = $this->getTitle()->getDefaultMessageText();
3496 if ( $oldtext !==
false ) {
3497 $oldtitlemsg =
'defaultmessagetext';
3498 $oldContent = $this->toEditContent( $oldtext );
3503 $oldContent = $this->getCurrentContent();
3506 $textboxContent = $this->toEditContent( $this->textbox1 );
3507 if ( $this->editRevId !==
null ) {
3508 $newContent = $this->page->replaceSectionAtRev(
3509 $this->section, $textboxContent, $this->sectiontitle, $this->editRevId
3512 $newContent = $this->page->replaceSectionContent(
3513 $this->section, $textboxContent, $this->sectiontitle, $this->edittime
3517 if ( $newContent ) {
3518 $this->getHookRunner()->onEditPageGetDiffContent( $this, $newContent );
3520 $user = $this->getUserForPreview();
3521 $parserOptions = ParserOptions::newFromUserAndLang( $user,
3522 MediaWikiServices::getInstance()->getContentLanguage() );
3523 $services = MediaWikiServices::getInstance();
3525 $newContent = $contentTransformer->preSaveTransform( $newContent, $this->page, $user, $parserOptions );
3528 if ( ( $oldContent && !$oldContent->isEmpty() ) || ( $newContent && !$newContent->isEmpty() ) ) {
3529 $oldtitle = $this->context->msg( $oldtitlemsg )->parse();
3530 $newtitle = $this->context->msg(
'yourtext' )->parse();
3532 if ( !$oldContent ) {
3533 $oldContent = $newContent->getContentHandler()->makeEmptyContent();
3536 if ( !$newContent ) {
3537 $newContent = $oldContent->getContentHandler()->makeEmptyContent();
3540 $de = $oldContent->getContentHandler()->createDifferenceEngine( $this->context );
3541 $de->setContent( $oldContent, $newContent );
3543 $difftext = $de->getDiff( $oldtitle, $newtitle );
3544 $de->showDiffStyle();
3549 $this->context->getOutput()->addHTML( Html::rawElement(
'div', [
'id' =>
'wikiDiff' ], $difftext ) );
3560 private function showTosSummary(): void {
3561 $msgKey =
'editpage-tos-summary';
3562 $this->getHookRunner()->onEditPageTosSummary( $this->getTitle(), $msgKey );
3563 $msg = $this->context->msg( $msgKey );
3564 if ( !$msg->isDisabled() ) {
3565 $this->context->getOutput()->addHTML( Html::rawElement(
3567 [
'class' =>
'mw-tos-summary' ],
3568 $msg->parseAsBlock()
3577 private function showEditTools(): void {
3578 $this->context->getOutput()->addHTML( Html::rawElement(
3580 [
'class' =>
'mw-editTools' ],
3581 $this->context->msg(
'edittools' )->inContentLanguage()->parse()
3595 $services = MediaWikiServices::getInstance();
3596 $rightsText = $services->
getMainConfig()->get( MainConfigNames::RightsText );
3597 if ( $rightsText ) {
3598 $copywarnMsg = [
'copyrightwarning',
3599 '[[' . $localizer->
msg(
'copyrightpage' )->inContentLanguage()->text() .
']]',
3602 $copywarnMsg = [
'copyrightwarning2',
3603 '[[' . $localizer->
msg(
'copyrightpage' )->inContentLanguage()->text() .
']]' ];
3606 $title = Title::newFromPageReference( $page );
3608 if ( !$copywarnMsg ) {
3612 $msg = $localizer->
msg( ...$copywarnMsg )->page( $page );
3613 return Html::rawElement(
'div', [
'id' =>
'editpage-copywarn' ], $msg->$format() );
3624 if ( !$output || !$output->getLimitReportData() ) {
3628 $limitReport = Html::rawElement(
'div', [
'class' =>
'mw-limitReportExplanation' ],
3629 wfMessage(
'limitreport-title' )->parseAsBlock()
3633 $limitReport .= Html::openElement(
'div', [
'class' =>
'preview-limit-report-wrapper' ] );
3635 $limitReport .= Html::openElement(
'table', [
3636 'class' =>
'preview-limit-report wikitable'
3638 Html::openElement(
'tbody' );
3640 $hookRunner =
new HookRunner( MediaWikiServices::getInstance()->getHookContainer() );
3641 foreach ( $output->getLimitReportData() as $key => $value ) {
3642 if ( in_array( $key, [
3643 'cachereport-origin',
3644 'cachereport-timestamp',
3646 'cachereport-transientcontent',
3647 'limitreport-timingprofile',
3655 if ( $hookRunner->onParserLimitReportFormat( $key, $value, $limitReport,
true,
true ) ) {
3658 if ( !$valueMsg->exists() ) {
3662 $valueMsg = (
new RawMessage(
'$1' ) )->params( $value );
3666 $valueMsg = $valueMsg->numParams( $value );
3668 if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) {
3669 $limitReport .= Html::rawElement(
'tr', [],
3670 Html::rawElement(
'th', [], $keyMsg->parse() ) .
3671 Html::rawElement(
'td', [], $valueMsg->parse() )
3677 $limitReport .= Html::closeElement(
'tbody' ) .
3678 Html::closeElement(
'table' ) .
3679 Html::closeElement(
'div' );
3681 return $limitReport;
3685 $out = $this->context->getOutput();
3686 $out->addHTML(
"<div class='editOptions'>\n" );
3688 if ( $this->section !==
'new' ) {
3689 $this->showSummaryInput(
false );
3690 $out->addHTML( $this->getSummaryPreview(
false ) );
3696 $expiryFromRequest =
null;
3697 if ( $this->preview || $this->diff || $this->isConflict ) {
3698 $expiryFromRequest = $this->getContext()->getRequest()->getText(
'wpWatchlistExpiry' );
3701 $checkboxes = $this->getCheckboxesWidget(
3703 [
'minor' => $this->minoredit,
'watch' => $this->watchthis,
'wpWatchlistExpiry' => $expiryFromRequest ]
3705 $checkboxesHTML =
new OOUI\HorizontalLayout( [
'items' => array_values( $checkboxes ) ] );
3707 $out->addHTML(
"<div class='editCheckboxes'>" . $checkboxesHTML .
"</div>\n" );
3710 $out->addHTML( self::getCopyrightWarning( $this->page,
'parse', $this->context ) );
3711 $out->addHTML( $this->editFormTextAfterWarn );
3713 $out->addHTML(
"<div class='editButtons'>\n" );
3714 $out->addHTML( implode(
"\n", $this->getEditButtons( $tabindex ) ) .
"\n" );
3716 $cancel = $this->getCancelLink( $tabindex++ );
3718 $edithelp = $this->getHelpLink() .
3719 $this->context->msg(
'word-separator' )->escaped() .
3720 $this->context->msg(
'newwindow' )->parse();
3722 $out->addHTML(
" <span class='cancelLink'>{$cancel}</span>\n" );
3723 $out->addHTML(
" <span class='editHelp'>{$edithelp}</span>\n" );
3724 $out->addHTML(
"</div><!-- editButtons -->\n" );
3726 $this->getHookRunner()->onEditPage__showStandardInputs_options( $this, $out, $tabindex );
3728 $out->addHTML(
"</div><!-- editOptions -->\n" );
3735 private function showConflict(): void {
3736 $out = $this->context->getOutput();
3737 if ( $this->getHookRunner()->onEditPageBeforeConflictDiff( $this, $out ) ) {
3738 $this->incrementConflictStats();
3740 $this->getEditConflictHelper()->showEditFormTextAfterFooters();
3744 private function incrementConflictStats(): void {
3745 $this->getEditConflictHelper()->incrementConflictStats( $this->context->getUser() );
3748 private function getHelpLink(): string {
3749 $message = $this->context->
msg(
'edithelppage' )->inContentLanguage()->text();
3750 $editHelpUrl = Skin::makeInternalOrExternalUrl( $message );
3751 return Html::element(
'a', [
3752 'href' => $editHelpUrl,
3753 'target' =>
'helpwindow'
3754 ], $this->context->msg(
'edithelp' )->text() );
3761 private function getCancelLink(
int $tabindex ): ButtonWidget {
3763 if ( !$this->isConflict && $this->oldid > 0 ) {
3764 $cancelParams[
'oldid'] = $this->oldid;
3765 } elseif ( $this->getContextTitle()->isRedirect() ) {
3766 $cancelParams[
'redirect'] =
'no';
3769 return new OOUI\ButtonWidget( [
3770 'id' =>
'mw-editform-cancel',
3771 'tabIndex' => $tabindex,
3772 'href' => $this->getContextTitle()->getLinkURL( $cancelParams ),
3773 'label' =>
new OOUI\HtmlSnippet( $this->context->msg(
'cancel' )->parse() ),
3775 'infusable' =>
true,
3776 'flags' =>
'destructive',
3790 $request = $this->context->getRequest();
3793 $allowedFormParams = [
3794 'section',
'oldid',
'preloadtitle',
'undo',
'undoafter',
3796 'uselang',
'useskin',
'useformat',
'variant',
'debug',
'safemode'
3798 $formParams = [
'action' => $this->action ];
3799 foreach ( $params as $arg => $val ) {
3800 if ( in_array( $arg, $allowedFormParams,
true ) ) {
3801 $formParams[$arg] = $val;
3814 $out = $this->context->getOutput();
3815 $config = $this->context->getConfig();
3817 if ( $config->get( MainConfigNames::RawHtml ) && !$this->mTokenOk ) {
3821 if ( $this->textbox1 !==
'' ) {
3825 $parsedNote = Html::rawElement(
'div', [
'class' =>
'previewnote' ],
3826 $out->parseAsInterface(
3827 $this->context->msg(
'session_fail_preview_html' )->plain()
3830 $this->incrementEditFailureStats(
'session_loss' );
3834 $previewStatus = StatusValue::newGood();
3835 $previewNoteHtml =
'';
3838 $content = $this->toEditContent( $this->textbox1 );
3841 if ( !$this->getHookRunner()->onAlternateEditPreview(
3842 $this, $content, $previewHTML, $this->mParserOutput )
3844 return $previewHTML;
3847 $continueEditingHtml = Html::rawElement(
3849 [
'class' =>
'mw-continue-editing' ],
3850 $this->linkRenderer->makePreloadedLink(
3852 $this->context->getLanguage()->getArrow() .
' ' . $this->context->msg(
'continue-editing' )->text()
3856 if ( $this->mTriedSave && !$this->mTokenOk ) {
3857 $previewStatus->fatal(
'session_fail_preview' );
3858 $this->incrementEditFailureStats(
'session_loss' );
3859 } elseif ( $this->incompleteForm ) {
3860 $previewStatus->fatal(
'edit_form_incomplete' );
3861 if ( $this->mTriedSave ) {
3862 $this->incrementEditFailureStats(
'incomplete_form' );
3865 $previewNoteHtml = Html::noticeBox(
3866 $this->context->msg(
'previewnote' )->parse() .
' ' . $continueEditingHtml
3870 # don't parse non-wikitext pages, show message about preview
3871 if ( $this->getTitle()->isUserConfigPage() || $this->getTitle()->isSiteConfigPage() ) {
3872 if ( $this->getTitle()->isUserConfigPage() ) {
3874 } elseif ( $this->getTitle()->isSiteConfigPage() ) {
3882 if ( $level ===
'user' && !$config->get( MainConfigNames::AllowUserCss ) ) {
3887 if ( $level ===
'user' ) {
3892 if ( $level ===
'user' && !$config->get( MainConfigNames::AllowUserJs ) ) {
3897 if ( $level ===
'user' && !$config->get( MainConfigNames::AllowUserJs ) ) {
3904 # Used messages to make sure grep find them:
3905 # Messages: usercsspreview, userjsonpreview, userjspreview,
3906 # sitecsspreview, sitejsonpreview, sitejspreview
3907 if ( $level && $format ) {
3908 $previewNoteHtml = Html::noticeBox( Html::rawElement(
3910 [
'id' =>
"mw-{$level}{$format}preview" ],
3911 $this->context->msg(
"{$level}{$format}preview" )->parse() . $continueEditingHtml
3916 if ( $this->section ===
"new" ) {
3917 $content = $content->addSectionHeader( $this->sectiontitle );
3921 $this->getHookRunner()->onEditPageGetPreviewContent( $this, $content );
3923 $parserResult = $this->doPreviewParse( $content );
3924 $parserOutput = $parserResult[
'parserOutput'];
3925 $previewHTML = $parserResult[
'html'];
3926 $this->mParserOutput = $parserOutput;
3927 $out->addParserOutputMetadata( $parserOutput );
3928 if ( $out->userCanPreview() ) {
3929 $out->addContentOverride( $this->getTitle(), $content );
3934 $constraintFactory = MediaWikiServices::getInstance()->getService(
'_EditConstraintFactory' );
3942 MessageValue::new(
'edit-constraint-warning-wrapper' ),
3943 $this->contentFormat,
3946 $previewStatus->merge( $constraintRunner->checkAllConstraints() );
3948 foreach ( $parserOutput->getWarningMsgs() as $warning ) {
3949 $previewStatus->warning( $warning );
3952 $previewStatus->fatal(
3953 'content-failed-to-parse',
3954 $this->contentModel,
3955 $this->contentFormat,
3961 if ( $this->isConflict ) {
3962 $conflict = Html::warningBox(
3963 $this->context->msg(
'previewconflict' )->escaped(),
3964 'mw-previewconflict'
3970 $previewhead = Html::rawElement(
3971 'div', [
'class' =>
'previewnote' ],
3973 'h2', [
'id' =>
'mw-previewheader' ],
3974 $this->context->msg(
'preview' )->text()
3975 ) . $this->formatConstraintStatus( $previewStatus ) . $previewNoteHtml . $conflict
3978 return $previewhead . $previewHTML . $this->previewTextAfterContent;
3981 private function incrementEditFailureStats(
string $failureType ): void {
3983 ->getCounter(
'edit_failure_total' )
3984 ->setLabel(
'cause', $failureType )
3985 ->setLabel(
'namespace',
'n/a' )
3986 ->setLabel(
'user_bucket',
'n/a' )
3995 $parserOptions = $this->page->makeParserOptions( $this->context );
3996 $parserOptions->setRenderReason(
'page-preview' );
3997 $parserOptions->setIsPreview(
true );
3998 $parserOptions->setIsSectionPreview( $this->section !==
'' );
3999 $parserOptions->setSuppressSectionEditLinks();
4006 return $parserOptions;
4019 $user = $this->getUserForPreview();
4020 $parserOptions = $this->getPreviewParserOptions();
4027 $services = MediaWikiServices::getInstance();
4030 $pstContent = $contentTransformer->preSaveTransform( $content, $this->page, $user, $parserOptions );
4031 $parserOutput = $contentRenderer->getParserOutput( $pstContent, $this->page,
null, $parserOptions );
4032 $out = $this->context->getOutput();
4033 $skin = $out->getSkin();
4034 $skinOptions = $skin->getOptions();
4037 $oldHtml = $parserOutput->getRawText();
4038 $html = $parserOutput->runOutputPipeline( $parserOptions, [
4039 'allowClone' =>
'false',
4040 'userLang' => $skin->getLanguage(),
4041 'injectTOC' => $skinOptions[
'toc'],
4042 'includeDebugInfo' =>
true,
4043 ] )->getContentHolderText();
4044 $parserOutput->setRawText( $oldHtml );
4046 'parserOutput' => $parserOutput,
4055 if ( $this->preview || $this->section !==
'' ) {
4057 if ( !$this->mParserOutput ) {
4061 $this->mParserOutput->getLinkList( ParserOutputLinkTypes::TEMPLATE )
4062 as [
'link' => $link ]
4064 $templates[] = Title::newFromLinkTarget( $link );
4068 return $this->getTitle()->getTemplateLinksFrom();
4078 $startingToolbar =
'<div id="toolbar"></div>';
4079 $toolbar = $startingToolbar;
4081 $hookRunner =
new HookRunner( MediaWikiServices::getInstance()->getHookContainer() );
4082 if ( !$hookRunner->onEditPageBeforeEditToolbar( $toolbar ) ) {
4086 return ( $toolbar === $startingToolbar ) ? null : $toolbar;
4117 $user = $this->context->getUser();
4119 if ( !$this->isNew && $this->permManager->userHasRight( $user,
'minoredit' ) ) {
4120 $checkboxes[
'wpMinoredit'] = [
4121 'id' =>
'wpMinoredit',
4122 'label-message' =>
'minoredit',
4124 'tooltip' =>
'minoredit',
4125 'label-id' =>
'mw-editpage-minoredit',
4126 'legacy-name' =>
'minor',
4127 'default' => $values[
'minor'],
4131 if ( $user->isNamed() ) {
4132 $checkboxes = array_merge(
4134 $this->getCheckboxesDefinitionForWatchlist( $values[
'watch'], $values[
'wpWatchlistExpiry'] ??
null )
4138 $this->getHookRunner()->onEditPageGetCheckboxesDefinition( $this, $checkboxes );
4150 private function getCheckboxesDefinitionForWatchlist( $watch, $watchexpiry ): array {
4153 'id' =>
'wpWatchthis',
4154 'label-message' =>
'watchthis',
4156 'tooltip' =>
'watch',
4157 'label-id' =>
'mw-editpage-watch',
4158 'legacy-name' =>
'watch',
4159 'default' => $watch,
4162 if ( $this->watchlistExpiryEnabled ) {
4163 $watchedItem = $this->watchedItemStore->getWatchedItem( $this->getContext()->getUser(), $this->getTitle() );
4166 $userPreferredExpiry =
'infinite';
4168 $userPreferredExpiryOption = !$this->getTitle()->exists()
4169 ?
'watchcreations-expiry'
4170 :
'watchdefault-expiry';
4171 $userPreferredExpiry = $this->userOptionsLookup->getOption(
4172 $this->getContext()->getUser(),
4173 $userPreferredExpiryOption,
4178 $expiryOptions = WatchAction::getExpiryOptions(
4179 $this->getContext(),
4181 $userPreferredExpiry
4184 if ( $watchexpiry && in_array( $watchexpiry, $expiryOptions[
'options'] ) ) {
4185 $expiryOptions[
'default'] = $watchexpiry;
4190 $expiryFromRequest = $this->
getContext()->getRequest()->getText(
'wpWatchlistExpiry' );
4191 if ( ( $this->preview || $this->diff ) && in_array( $expiryFromRequest, $expiryOptions[
'options'] ) ) {
4192 $expiryOptions[
'default'] = $expiryFromRequest;
4197 foreach ( $expiryOptions[
'options'] as $label => $value ) {
4198 $options[] = [
'data' => $value,
'label' => $label ];
4201 $fieldDefs[
'wpWatchlistExpiry'] = [
4202 'id' =>
'wpWatchlistExpiry',
4203 'label-message' =>
'confirm-watch-label',
4205 'tooltip' =>
'watchlist-expiry',
4206 'label-id' =>
'mw-editpage-watchlist-expiry',
4207 'default' => $expiryOptions[
'default'],
4208 'value-attr' =>
'value',
4209 'class' => DropdownInputWidget::class,
4210 'options' => $options,
4211 'invisibleLabel' =>
true,
4229 $checkboxesDef = $this->getCheckboxesDefinition( $values );
4231 foreach ( $checkboxesDef as $name => $options ) {
4232 $legacyName = $options[
'legacy-name'] ?? $name;
4236 if ( isset( $options[
'tooltip'] ) ) {
4237 $accesskey = $this->context->msg(
"accesskey-{$options['tooltip']}" )->text();
4238 $title = Linker::titleAttrib( $options[
'tooltip'] );
4240 if ( isset( $options[
'title-message'] ) ) {
4241 $title = $this->context->msg( $options[
'title-message'] )->text();
4245 $className = $options[
'class'] ?? CheckboxInputWidget::class;
4246 $valueAttr = $options[
'value-attr'] ??
'selected';
4247 $checkboxes[ $legacyName ] =
new FieldLayout(
4249 'tabIndex' => ++$tabindex,
4250 'accessKey' => $accesskey,
4251 'id' => $options[
'id'] .
'Widget',
4252 'inputId' => $options[
'id'],
4254 $valueAttr => $options[
'default'],
4255 'infusable' =>
true,
4256 'options' => $options[
'options'] ??
null,
4259 'align' =>
'inline',
4260 'label' =>
new OOUI\HtmlSnippet( $this->context->msg( $options[
'label-message'] )->parse() ),
4262 'id' => $options[
'label-id'] ??
null,
4263 'invisibleLabel' => $options[
'invisibleLabel'] ??
null,
4274 private function getSubmitButtonLabel(): string {
4276 $this->context->getConfig()->get(
MainConfigNames::EditSubmitButtonLabelPublish );
4279 $newPage = !$this->page->exists();
4281 if ( $labelAsPublish ) {
4282 $buttonLabelKey = $newPage ?
'publishpage' :
'publishchanges';
4284 $buttonLabelKey = $newPage ?
'savearticle' :
'savechanges';
4287 return $buttonLabelKey;
4304 $this->context->getConfig()->get( MainConfigNames::EditSubmitButtonLabelPublish );
4306 $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
4307 $buttonTooltip = $labelAsPublish ?
'publish' :
'save';
4309 $buttons[
'save'] =
new OOUI\ButtonInputWidget( [
4311 'tabIndex' => ++$tabindex,
4312 'id' =>
'wpSaveWidget',
4313 'inputId' =>
'wpSave',
4315 'useInputTag' =>
true,
4316 'flags' => [
'progressive',
'primary' ],
4317 'label' => $buttonLabel,
4318 'infusable' =>
true,
4321 'title' => Linker::titleAttrib( $buttonTooltip ),
4323 'accessKey' => Linker::accesskey( $buttonTooltip ),
4326 $buttons[
'preview'] =
new OOUI\ButtonInputWidget( [
4327 'name' =>
'wpPreview',
4328 'tabIndex' => ++$tabindex,
4329 'id' =>
'wpPreviewWidget',
4330 'inputId' =>
'wpPreview',
4332 'useInputTag' =>
true,
4333 'label' => $this->context->msg(
'showpreview' )->text(),
4334 'infusable' =>
true,
4337 'formNoValidate' =>
true,
4339 'title' => Linker::titleAttrib(
'preview' ),
4341 'accessKey' => Linker::accesskey(
'preview' ),
4344 $buttons[
'diff'] =
new OOUI\ButtonInputWidget( [
4346 'tabIndex' => ++$tabindex,
4347 'id' =>
'wpDiffWidget',
4348 'inputId' =>
'wpDiff',
4350 'useInputTag' =>
true,
4351 'label' => $this->context->msg(
'showdiff' )->text(),
4352 'infusable' =>
true,
4355 'formNoValidate' =>
true,
4357 'title' => Linker::titleAttrib(
'diff' ),
4359 'accessKey' => Linker::accesskey(
'diff' ),
4362 $this->getHookRunner()->onEditPageBeforeEditButtons( $this, $buttons, $tabindex );
4371 private function noSuchSectionPage(): void {
4372 $out = $this->context->getOutput();
4373 $out->prepareErrorPage();
4374 $out->setPageTitleMsg( $this->context->msg(
'nosuchsectiontitle' ) );
4376 $res = $this->context->msg(
'nosuchsectiontext', $this->section )->parseAsBlock();
4378 $this->getHookRunner()->onEditPageNoSuchSection( $this, $res );
4379 $out->addHTML( $res );
4381 $out->returnToMain(
false, $this->page );
4390 $this->textbox2 = $this->textbox1;
4392 $out = $this->context->getOutput();
4393 $out->prepareErrorPage();
4394 $out->setPageTitleMsg( $this->context->msg(
'spamprotectiontitle' ) );
4396 $spamText = $this->context->msg(
'spamprotectiontext' )->parseAsBlock();
4399 if ( is_array( $match ) ) {
4402 $matchText = $this->context->getLanguage()->listToText( array_map(
'wfEscapeWikiText', $match ) );
4407 $spamText .= $this->context->msg(
'spamprotectionmatch', $matchText )->parseAsBlock();
4409 $out->addHTML( Html::rawElement(
4411 [
'id' =>
'spamprotected' ],
4415 $out->wrapWikiMsg(
'<h2>$1</h2>',
"yourdiff" );
4418 $out->wrapWikiMsg(
'<h2>$1</h2>',
"yourtext" );
4419 $this->showTextbox( $this->textbox2,
'wpTextbox2', [
'tabindex' => 6,
'readonly' ] );
4421 $out->addReturnTo( $this->getContextTitle(), [
'action' =>
'edit' ] );
4424 private function addLongPageWarningHeader(): void {
4425 if ( $this->contentLength === false ) {
4426 $this->contentLength = strlen( $this->textbox1 );
4429 $out = $this->context->getOutput();
4430 $longPageHint = $this->context->msg(
'longpage-hint' );
4431 if ( !$longPageHint->isDisabled() ) {
4432 $msgText = trim( $longPageHint->sizeParams( $this->contentLength )
4433 ->params( $this->contentLength )
4435 if ( $msgText !==
'' && $msgText !==
'-' ) {
4436 $out->addHTML(
"<div id='mw-edit-longpage-hint'>\n$msgText\n</div>" );
4441 private function addExplainConflictHeader(): void {
4443 $this->getEditConflictHelper()->getExplainHeader()
4452 Assert::precondition( !$this->editConflictHelperFactory,
4453 'Can only have one extension that resolves edit conflicts' );
4454 $this->editConflictHelperFactory = $factory;
4458 if ( !$this->editConflictHelper ) {
4459 $label = $this->getSubmitButtonLabel();
4460 if ( $this->editConflictHelperFactory ) {
4461 $this->editConflictHelper = ( $this->editConflictHelperFactory )( $label );
4463 $this->editConflictHelper =
new TextConflictHelper(
4465 $this->getContext()->getOutput(),
4466 MediaWikiServices::getInstance()->getStatsFactory(),
4468 MediaWikiServices::getInstance()->getContentHandlerFactory()
4472 return $this->editConflictHelper;
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, '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'=> '', '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'=>[], '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'=> false, '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 -o $output $input', 'ImagickExt'=>['SvgHandler::rasterizeImagickExt',],], 'SVGConverter'=> 'ImageMagick', 'SVGConverterPath'=> '', 'SVGMaxSize'=> 5120, 'SVGMetadataCutoff'=> 5242880, 'SVGNativeRendering'=> true, 'SVGNativeRenderingSizeLimit'=> 51200, 'MediaInTargetLanguage'=> true, 'MaxImageArea'=> 12500000, 'MaxAnimatedGifArea'=> 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, 'ThumbnailStepsRatio'=> 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, 'UserEmailConfirmationUseHTML'=> false, 'PasswordExpirationDays'=> false, 'PasswordExpireGrace'=> 604800, 'SMTP'=> false, 'AdditionalMailParams'=> null, 'AllowHTMLEmail'=> false, 'EnotifFromEditor'=> false, 'EmailAuthentication'=> true, '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'=>[], 'FileSchemaMigrationStage'=> 3, 'ImageLinksSchemaMigrationStage'=> 768, 'ExternalLinksDomainGaps'=>[], 'ContentHandlers'=>['wikitext'=>['class'=> 'MediaWiki\\Content\\WikitextContentHandler', 'services'=>['TitleFactory', 'ParserFactory', 'GlobalIdGenerator', 'LanguageNameUtils', 'LinkRenderer', 'MagicWordFactory', 'ParsoidParserFactory',],], 'javascript'=>['class'=> 'MediaWiki\\Content\\JavaScriptContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup',],], 'json'=>['class'=> 'MediaWiki\\Content\\JsonContentHandler', 'services'=>['ParsoidParserFactory', 'TitleFactory',],], 'css'=>['class'=> 'MediaWiki\\Content\\CssContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup',],], 'vue'=>['class'=> 'MediaWiki\\Content\\VueContentHandler', 'services'=>['MainConfig', 'ParserFactory',],], '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, 'WarmParsoidParserCache'=> false,], 'ParsoidSelectiveUpdateSampleRate'=> 0, 'ParserCacheFilterConfig'=>['pcache'=>['default'=>['minCpuTime'=> 0,],], 'parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],], 'postproc-parsoid-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],],], 'ChronologyProtectorSecret'=> '', 'ParserCacheExpireTime'=> 86400, 'ParserCacheAsyncExpireTime'=> 60, 'ParserCacheAsyncRefreshJobs'=> true, 'OldRevisionParserCacheExpireTime'=> 3600, 'ObjectCacheSessionExpiry'=> 3600, 'PHPSessionHandling'=> 'warn', 'SuspiciousIpExpiry'=> false, 'SessionPbkdf2Iterations'=> 10001, 'UseSessionCookieJwt'=> false, 'UseSessionCookieForBotPasswords'=> 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, 'ForcedRawSMaxage'=> 300, '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',],],], '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, ], '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, 'UseLegacyMediaStyles' => 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, ], ], '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, ], 'AllowSecuritySensitiveOperationIfCannotReauthenticate' => [ 'default' => true, ], '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, '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, ], '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, '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' => [ ], '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, 'pagelang' => true, ], 'editprotected' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'editprotected' => true, ], 'editmycssjs' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, ], 'editmyoptions' => [ 'editmyoptions' => true, 'editmyuserjson' => true, ], 'editinterface' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, ], 'editsiteconfig' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => 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, '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, '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, 'editprotected' => true, 'protect' => true, ], 'viewmywatchlist' => [ 'viewmywatchlist' => true, ], 'editmywatchlist' => [ 'editmywatchlist' => true, ], 'sendemail' => [ 'sendemail' => true, ], 'createaccount' => [ 'createaccount' => true, ], 'privateinfo' => [ 'viewmyprivateinfo' => true, ], 'mergehistory' => [ 'mergehistory' => 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', 'editviewmywatchlist' => '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', ], 'GrantRiskGroups' => [ 'basic' => 'low', 'editpage' => 'low', 'createeditmovepage' => 'low', 'editprotected' => 'vandalism', 'patrol' => 'low', 'uploadfile' => 'low', 'uploadeditmovefile' => 'low', 'sendemail' => 'security', 'viewmywatchlist' => 'low', 'editviewmywatchlist' => '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', ], 'EnableBotPasswords' => true, 'BotPasswordsCluster' => false, 'BotPasswordsDatabase' => false, 'BotPasswordsLimit' => 100, 'SecretKey' => false, 'JwtPrivateKey' => false, 'JwtPublicKey' => false, 'AllowUserJs' => false, 'AllowUserCss' => false, 'AllowUserCssPrefs' => true, 'UseSiteJs' => true, 'UseSiteCss' => true, 'BreakFrames' => false, 'EditPageFrameOptions' => 'DENY', 'ApiFrameOptions' => 'DENY', 'CSPHeader' => false, 'CSPReportOnlyHeader' => 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, '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' => [ ], 'StatsdServer' => false, 'StatsdMetricPrefix' => 'MediaWiki', 'StatsTarget' => null, 'StatsFormat' => null, 'StatsPrefix' => 'mediawiki', 'OpenTelemetryConfig' => null, 'PageInfoTransclusionLimit' => 50, 'EnableJavaScriptTest' => false, 'CachePrefix' => false, 'DebugToolbar' => false, '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: ], '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' => [ ], 'RCEngines' => [ 'redis' => 'MediaWiki\\RCFeed\\RedisPubSubFeedEngine', 'udp' => 'MediaWiki\\RCFeed\\UDPRCFeedEngine', ], '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, ], '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, '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\\JobQueue\\Jobs\\CategoryMembershipChangeJob', 'services' => [ 'RecentChangeFactory', ], ], 'CategoryCountUpdateJob' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\CategoryCountUpdateJob', 'services' => [ 'ConnectionProvider', 'NamespaceInfo', ], ], 'clearUserWatchlist' => 'MediaWiki\\Watchlist\\ClearUserWatchlistJob', 'watchlistExpiry' => 'MediaWiki\\Watchlist\\WatchlistExpiryJob', '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', 'parsoidCachePrewarm' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\ParsoidCachePrewarmJob', 'services' => [ 'ParserOutputAccess', 'PageStore', 'RevisionLookup', 'ParsoidSiteConfig', ], 'needsPage' => false, ], '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, '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', 'Access-Control-Max-Age', 'Authorization', ], 'RestAPIAdditionalRouteFiles' => [ ], 'RestSandboxSpecs' => [ ], '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, 'AsyncHTTPTimeout' => 25, 'HTTPProxy' => '', 'LocalVirtualHosts' => [ ], 'LocalHTTPProxy' => false, 'AllowExternalReqID' => false, 'GenerateReqIDFormat' => 'rand24', 'JobRunRate' => 1, 'RunJobsAsync' => false, 'UpdateRowsPerJob' => 300, 'UpdateRowsPerQuery' => 100, 'RedirectOnLogin' => null, 'VirtualRestConfig' => [ 'paths' => [ ], 'modules' => [ ], 'global' => [ 'timeout' => 360, 'forwardCookies' => false, 'HTTPProxy' => 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' => [ ], 'CloneArticleParserOutput' => true, 'UseLeximorph' => false, 'UsePostprocCache' => false, 'UsePostprocCacheLegacy' => false, 'UsePostprocCacheParsoid' => false, 'ParserOptionsLogUnsafeSampleRate' => 0, ], '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', 'CacheSharedUploads' => 'boolean', 'ForeignUploadTargets' => 'array', 'UploadDialog' => 'object', 'FileBackends' => 'object', 'LockManagers' => 'array', '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', ], 'ThumbnailStepsRatio' => [ 'number', 'null', ], 'ThumbnailBuckets' => [ 'array', 'null', ], 'UploadThumbnailRenderMap' => 'object', 'GalleryOptions' => 'object', 'DjvuDump' => [ 'string', 'null', ], 'DjvuRenderer' => [ 'string', 'null', ], 'DjvuTxt' => [ 'string', 'null', ], 'DjvuPostProcessor' => [ 'string', 'null', ], 'UserEmailConfirmationUseHTML' => 'boolean', 'SMTP' => [ 'boolean', 'object', ], 'EnotifFromEditor' => 'boolean', 'EnotifRevealEditorAddress' => 'boolean', 'UsersNotifiedOnAllChanges' => 'object', 'DBmwschema' => [ 'string', 'null', ], 'SharedTables' => 'array', 'DBservers' => [ 'boolean', 'array', ], 'LBFactoryConf' => 'object', 'LocalDatabases' => 'array', 'VirtualDomainsMapping' => 'object', 'FileSchemaMigrationStage' => 'integer', 'ImageLinksSchemaMigrationStage' => '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', 'ParserCacheFilterConfig' => 'object', 'ChronologyProtectorSecret' => 'string', 'PHPSessionHandling' => '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', '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', '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', 'AllowSecuritySensitiveOperationIfCannotReauthenticate' => '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', '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', 'CSPHeader' => [ 'boolean', 'object', ], 'CSPReportOnlyHeader' => [ 'boolean', 'object', ], 'CSPFalsePositiveUrls' => 'object', 'AllowCrossOrigin' => 'boolean', 'RestAllowCrossOriginCookieAuth' => 'boolean', 'CookieSameSite' => [ 'string', 'null', ], 'CacheVaryCookies' => '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', 'RCEngines' => 'object', 'OverrideSiteFeed' => 'object', 'FeedClasses' => 'object', 'AdvertisedFeedTypes' => 'array', 'SoftwareTags' => 'object', 'RecentChangesFlags' => 'object', 'WatchlistExpiry' => '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', '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', 'RestSandboxSpecs' => 'object', 'ShellRestrictionMethod' => [ 'string', 'boolean', ], 'ShellboxUrls' => 'object', 'ShellboxSecretKey' => [ 'string', 'null', ], 'ShellboxShell' => [ 'string', 'null', ], 'HTTPTimeout' => 'number', 'HTTPConnectTimeout' => 'number', 'HTTPMaxTimeout' => 'number', 'HTTPMaxConnectTimeout' => 'number', 'LocalVirtualHosts' => 'object', 'LocalHTTPProxy' => [ 'string', 'boolean', ], 'GenerateReqIDFormat' => 'string', 'VirtualRestConfig' => 'object', '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', 'CloneArticleParserOutput' => 'boolean', 'UseLeximorph' => 'boolean', 'UsePostprocCache' => 'boolean', 'UsePostprocCacheLegacy' => 'boolean', 'UsePostprocCacheParsoid' => 'boolean', 'ParserOptionsLogUnsafeSampleRate' => 'integer', ], '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', 'VirtualRestConfig' => 'array_plus_2d', ], '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', ], ], ], ], ], 'PHPSessionHandling' => [ 'deprecated' => 'since 1.45 Integration with PHP session handling will be removed in the future', ], 'RawHtmlMessages' => [ 'items' => [ 'type' => 'string', ], ], 'InterwikiLogoOverride' => [ 'items' => [ 'type' => 'string', ], ], 'LegalTitleChars' => [ 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize', ], 'ReauthenticateTime' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'AllowSecuritySensitiveOperationIfCannotReauthenticate' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], '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', ], ], ], 'SoftwareTags' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], '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', ], ], 'RestSandboxSpecs' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'url' => [ 'type' => 'string', 'format' => 'url', ], 'name' => [ 'type' => 'string', ], 'file' => [ 'type' => 'string', ], 'msg' => [ 'type' => 'string', 'description' => 'a message key', ], ], ], ], '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.', ],]