X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=0e18e46a3b2a21d76e3f8cf4ad6970fc07010508;hb=a6bd784b9ba15d48dd83cd46fd91d49eda77f994;hp=eacd370afd27b0e2d84793bf24264951749db597;hpb=0756849eb8450909d14dcb619307bdf07f0c7fcd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index eacd370afd..0e18e46a3b 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -216,7 +216,9 @@ class ProtectionForm { 'protect-norestrictiontypes-title', $this->mTitle->getPrefixedText() ) ); - $out->addWikiText( $this->mContext->msg( 'protect-norestrictiontypes-text' )->plain() ); + $out->addWikiTextAsInterface( + $this->mContext->msg( 'protect-norestrictiontypes-text' )->plain() + ); // Show the log in case protection was possible once $this->showLogExtract( $out ); @@ -246,7 +248,9 @@ class ProtectionForm { $this->mContext->msg( 'protect-title-notallowed', $this->mTitle->getPrefixedText() ) ); - $out->addWikiText( $out->formatPermissionsErrorMessage( $this->mPermErrors, 'protect' ) ); + $out->addWikiTextAsInterface( $out->formatPermissionsErrorMessage( + $this->mPermErrors, 'protect' + ) ); } else { $out->setPageTitle( $this->mContext->msg( 'protect-title', $this->mTitle->getPrefixedText() ) ); $out->addWikiMsg( 'protect-text', @@ -313,7 +317,7 @@ class ProtectionForm { ); if ( !$status->isOK() ) { - $this->show( $out->parseInline( $status->getWikiText() ) ); + $this->show( $out->parseInlineAsInterface( $status->getWikiText() ) ); return false; } @@ -349,13 +353,9 @@ class ProtectionForm { $user = $context->getUser(); $output = $context->getOutput(); $lang = $context->getLanguage(); - $conf = $context->getConfig(); - $cascadingRestrictionLevels = $conf->get( 'CascadingRestrictionLevels' ); - $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; $out = ''; if ( !$this->disabled ) { $output->addModules( 'mediawiki.legacy.protect' ); - $output->addJsConfigVars( 'wgCascadeableLevels', $cascadingRestrictionLevels ); $out .= Xml::openElement( 'form', [ 'method' => 'post', 'action' => $this->mTitle->getLocalURL( 'action=protect' ), 'id' => 'mw-Protect-Form' ] ); @@ -498,10 +498,10 @@ class ProtectionForm { // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP // (e.g. emojis) count for two each. This limit is overridden in JS to instead count - // Unicode codepoints (or 180 UTF-8 bytes for old schema). + // Unicode codepoints. // Subtract arbitrary 75 to leave some space for the autogenerated null edit's summary // and other texts chosen by dropdown menus on this page. - $maxlength = $oldCommentSchema ? 180 : CommentStore::COMMENT_CHARACTER_LIMIT - 75; + $maxlength = CommentStore::COMMENT_CHARACTER_LIMIT - 75; $out .= Xml::openElement( 'table', [ 'id' => 'mw-protect-table3' ] ) . Xml::openElement( 'tbody' ); @@ -622,10 +622,10 @@ class ProtectionForm { /** * Show protection long extracts for this page * - * @param OutputPage &$out - * @access private + * @param OutputPage $out + * @private */ - function showLogExtract( &$out ) { + function showLogExtract( OutputPage $out ) { # Show relevant lines from the protection log: $protectLogPage = new LogPage( 'protect' ); $out->addHTML( Xml::element( 'h2', null, $protectLogPage->getName()->text() ) );