X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=fe0014992034ede7b65a5abf3d63eaa309a02297;hb=4f3d131492de5491d4be6d8d67d786b0703a8c49;hp=6ae4371a104b5fc5a0fc24b5aeb9a60b92aa6c47;hpb=824469f51cc1c159130bd4eddcf98cbf528798b6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 6ae4371a10..fe00149920 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -25,7 +25,7 @@ use MediaWiki\EditPage\TextboxBuilder; use MediaWiki\EditPage\TextConflictHelper; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; -use MediaWiki\Storage\RevisionRecord; +use MediaWiki\Revision\RevisionRecord; use Wikimedia\ScopedCallback; /** @@ -1156,7 +1156,7 @@ class EditPage { $out->showErrorPage( 'modeleditnotsupported-title', 'modeleditnotsupported-text', - $modelName + [ $modelName ] ); return false; } @@ -1188,11 +1188,13 @@ class EditPage { /** * @param Content|null $def_content The default value to return * - * @return Content|null Content on success, $def_content for invalid sections + * @return Content|false|null Content on success, $def_content for invalid sections * * @since 1.21 */ protected function getContentObject( $def_content = null ) { + global $wgDisableAnonTalk; + $content = false; $user = $this->context->getUser(); @@ -1292,8 +1294,11 @@ class EditPage { $undo )->inContentLanguage()->text(); } else { + $undoMessage = ( $undorev->getUser() === 0 && $wgDisableAnonTalk ) ? + 'undo-summary-anon' : + 'undo-summary'; $undoSummary = $this->context->msg( - 'undo-summary', + $undoMessage, $undo, $userText )->inContentLanguage()->text(); @@ -1678,7 +1683,9 @@ class EditPage { case self::AS_CANNOT_USE_CUSTOM_MODEL: case self::AS_PARSE_ERROR: case self::AS_UNICODE_NOT_SUPPORTED: - $out->wrapWikiTextAsInterface( 'error', $status->getWikiText() ); + $out->wrapWikiTextAsInterface( 'error', + $status->getWikiText( false, false, $this->context->getLanguage() ) + ); return true; case self::AS_SUCCESS_NEW_ARTICLE: @@ -1752,7 +1759,8 @@ class EditPage { // is if an extension hook aborted from inside ArticleSave. // Render the status object into $this->hookError // FIXME this sucks, we should just use the Status object throughout - $this->hookError = '