X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22config_fonctions%22%2C%20%22image_process=%24process%22%29%20.%20%22?a=blobdiff_plain;f=includes%2FEditPage.php;h=38f8ab69b21966188bfc4e1f58c3a11112434975;hb=5e4facec788bd45586c66a04b6fcb26c83f46902;hp=606b4cde02592bf27a9f38e71824948b0d350a94;hpb=4864bb93d9064127c93f3ca14fa8d146f269202a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 606b4cde02..38f8ab69b2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1846,8 +1846,17 @@ class EditPage { } elseif ( !$wgUser->isAllowed( 'editcontentmodel' ) ) { $status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL ); return $status; - } + // Make sure the user can edit the page under the new content model too + $titleWithNewContentModel = clone $this->mTitle; + $titleWithNewContentModel->setContentModel( $this->contentModel ); + if ( !$titleWithNewContentModel->userCan( 'editcontentmodel', $wgUser ) + || !$titleWithNewContentModel->userCan( 'edit', $wgUser ) + ) { + $status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL ); + return $status; + } + $changingContentModel = true; $oldContentModel = $this->mTitle->getContentModel(); } @@ -3291,6 +3300,12 @@ HTML 'id' => $name, 'cols' => $wgUser->getIntOption( 'cols' ), 'rows' => $wgUser->getIntOption( 'rows' ), + // The following classes can be used here: + // * mw-editfont-default + // * mw-editfont-monospace + // * mw-editfont-sans-serif + // * mw-editfont-serif + 'class' => 'mw-editfont-' . $wgUser->getOption( 'editfont' ), // Avoid PHP notices when appending preferences // (appending allows customAttribs['style'] to still work). 'style' => '' @@ -3487,7 +3502,7 @@ HTML * @param string $format Output format, valid values are any function of a Message object * @return string */ - public static function getCopyrightWarning( $title, $format = 'plain' ) { + public static function getCopyrightWarning( $title, $format = 'plain', $langcode = null ) { global $wgRightsText; if ( $wgRightsText ) { $copywarnMsg = [ 'copyrightwarning', @@ -3500,8 +3515,12 @@ HTML // Allow for site and per-namespace customization of contribution/copyright notice. Hooks::run( 'EditPageCopyrightWarning', [ $title, &$copywarnMsg ] ); + $msg = call_user_func_array( 'wfMessage', $copywarnMsg )->title( $title ); + if ( $langcode ) { + $msg->inLanguage( $langcode ); + } return "
\n" . - call_user_func_array( 'wfMessage', $copywarnMsg )->title( $title )->$format() . "\n
"; + $msg->$format() . "\n"; } /** @@ -4254,7 +4273,7 @@ HTML protected function safeUnicodeOutput( $text ) { return $this->checkUnicodeCompliantBrowser() ? $text - : $this->makesafe( $text ); + : $this->makeSafe( $text ); } /**