X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2FEditPage.php;h=7bdc3bc940ccd34ac2d78453ab12fda8c3aec5dc;hb=ec505eb2548e31e14691698f6ef296d73bb4ce44;hp=c22125a6a2ad9e0ac98f3e3f2b2022c4b6828701;hpb=0b6930c6216313d3ddf521b07516b539a5f92113;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index c22125a6a2..7bdc3bc940 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1027,7 +1027,7 @@ class EditPage { throw new ErrorPageError( 'editpage-invalidcontentmodel-title', 'editpage-invalidcontentmodel-text', - [ $this->contentModel ] + [ wfEscapeWikiText( $this->contentModel ) ] ); } @@ -1035,7 +1035,10 @@ class EditPage { throw new ErrorPageError( 'editpage-notsupportedcontentformat-title', 'editpage-notsupportedcontentformat-text', - [ $this->contentFormat, ContentHandler::getLocalizedName( $this->contentModel ) ] + [ + wfEscapeWikiText( $this->contentFormat ), + wfEscapeWikiText( ContentHandler::getLocalizedName( $this->contentModel ) ) + ] ); } @@ -2318,12 +2321,9 @@ class EditPage { } public function setHeaders() { - global $wgOut, $wgUser, $wgAjaxEditStash, $wgCookieSetOnAutoblock; + global $wgOut, $wgUser, $wgAjaxEditStash; $wgOut->addModules( 'mediawiki.action.edit' ); - if ( $wgCookieSetOnAutoblock === true ) { - $wgOut->addModules( 'mediawiki.user.blockcookie' ); - } $wgOut->addModuleStyles( 'mediawiki.action.edit.styles' ); if ( $wgUser->getOption( 'showtoolbar' ) ) { @@ -2424,7 +2424,7 @@ class EditPage { # Show log extract when the user is currently blocked if ( $namespace == NS_USER || $namespace == NS_USER_TALK ) { $username = explode( '/', $this->mTitle->getText(), 2 )[0]; - $user = User::newFromName( $username, false /* allow IP users*/ ); + $user = User::newFromName( $username, false /* allow IP users */ ); $ip = User::isIP( $username ); $block = Block::newFromTarget( $user, $user ); if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist @@ -2633,7 +2633,7 @@ class EditPage { } // @todo add EditForm plugin interface and use it here! - // search for textarea1 and textares2, and allow EditForm to override all uses. + // search for textarea1 and textarea2, and allow EditForm to override all uses. $wgOut->addHTML( Html::openElement( 'form', [ @@ -3061,6 +3061,7 @@ class EditPage { */ protected function showSummaryInput( $isSubjectPreview, $summary = "" ) { global $wgOut; + # Add a class if 'missingsummary' is triggered to allow styling of the summary line $summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary'; if ( $isSubjectPreview ) { @@ -3509,12 +3510,12 @@ HTML $message = $this->context->msg( 'edithelppage' )->inContentLanguage()->text(); $edithelpurl = Skin::makeInternalOrExternalUrl( $message ); - $attrs = [ - 'target' => 'helpwindow', - 'href' => $edithelpurl, - ]; - $edithelp = Html::linkButton( $this->context->msg( 'edithelp' )->text(), - $attrs, [ 'mw-ui-quiet' ] ) . + $edithelp = + Html::linkButton( + $this->context->msg( 'edithelp' )->text(), + [ 'target' => 'helpwindow', 'href' => $edithelpurl ], + [ 'mw-ui-quiet' ] + ) . $this->context->msg( 'word-separator' )->escaped() . $this->context->msg( 'newwindow' )->parse(); @@ -3574,18 +3575,16 @@ HTML */ public function getCancelLink() { $cancelParams = []; - $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); if ( !$this->isConflict && $this->oldid > 0 ) { $cancelParams['oldid'] = $this->oldid; } elseif ( $this->getContextTitle()->isRedirect() ) { $cancelParams['redirect'] = 'no'; } - $attrs = [ 'id' => 'mw-editform-cancel' ]; - return $linkRenderer->makeKnownLink( + return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink( $this->getContextTitle(), new HtmlArmor( $this->context->msg( 'cancel' )->parse() ), - Html::buttonAttributes( $attrs, [ 'mw-ui-quiet' ] ), + Html::buttonAttributes( [ 'id' => 'mw-editform-cancel' ], [ 'mw-ui-quiet' ] ), $cancelParams ); } @@ -4009,72 +4008,114 @@ HTML return $toolbar; } + /** + * Return an array of checkbox definitions. + * + * Array keys correspond to the `` 'name' attribute to use for each checkbox. + * + * Array values are associative arrays with the following keys: + * - 'label-message' (required): message for label text + * - 'id' (required): 'id' attribute for the `` + * - 'default' (required): default checkedness (true or false) + * - 'title-message' (optional): used to generate 'title' attribute for the `