X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialPageLanguage.php;fp=includes%2Fspecials%2FSpecialPageLanguage.php;h=78a453e7b15d6b25de769639cf455ded8d3c8b03;hp=2943fd4e3d697cc75056ae07c9140e3ff02ac422;hb=6c9a2923fe1ee3a65cb027be5e781772f2b12fbd;hpb=89539f2aa1b158fdcc703ad053e2580cb97a6385 diff --git a/includes/specials/SpecialPageLanguage.php b/includes/specials/SpecialPageLanguage.php index 2943fd4e3d..78a453e7b1 100644 --- a/includes/specials/SpecialPageLanguage.php +++ b/includes/specials/SpecialPageLanguage.php @@ -135,6 +135,16 @@ class SpecialPageLanguage extends FormSpecialPage { return Status::newFatal( $ex->getMessageObject() ); } + // Check permissions and make sure the user has permission to edit the page + $errors = $title->getUserPermissionsErrors( 'edit', $this->getUser() ); + + if ( $errors ) { + $out = $this->getOutput(); + $wikitext = $out->formatPermissionsErrorMessage( $errors ); + // Hack to get our wikitext parsed + return Status::newFatal( new RawMessage( '$1', [ $wikitext ] ) ); + } + // Url to redirect to after the operation $this->goToUrl = $title->getFullUrlForRedirect( $title->isRedirect() ? [ 'redirect' => 'no' ] : []