X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMovepage.php;h=599ab31135c9d6a462ea5e49a7216d39ffec046e;hb=d786ea73c0c6ed256f56f79d62c5c63bf834158e;hp=5cbad8a33b7ac0ae4bab90dfe15bbdb02c6107aa;hpb=dc92754891d0333e972dd1aa74a61631eddd78df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 5cbad8a33b..599ab31135 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -122,7 +122,7 @@ class MovePageForm extends UnlistedSpecialPage { $this->moveOverShared = $request->getBool( 'wpMoveOverSharedFile' ); $this->watch = $request->getCheck( 'wpWatch' ) && $user->isLoggedIn(); - if ( 'submit' == $request->getVal( 'action' ) && $request->wasPosted() + if ( $request->getVal( 'action' ) == 'submit' && $request->wasPosted() && $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { $this->doSubmit(); @@ -137,8 +137,9 @@ class MovePageForm extends UnlistedSpecialPage { * @param array $err Error messages. Each item is an error message. * It may either be a string message name or array message name and * parameters, like the second argument to OutputPage::wrapWikiMsg(). + * @param bool $isPermError Whether the error message is about user permissions. */ - function showForm( $err ) { + function showForm( $err, $isPermError = false ) { $this->getSkin()->setRelevantTitle( $this->oldTitle ); $out = $this->getOutput(); @@ -235,9 +236,13 @@ class MovePageForm extends UnlistedSpecialPage { } if ( count( $err ) ) { - $action_desc = $this->msg( 'action-move' )->plain(); - $errMsgHtml = $this->msg( 'permissionserrorstext-withaction', - count( $err ), $action_desc )->parseAsBlock(); + if ( $isPermError ) { + $action_desc = $this->msg( 'action-move' )->plain(); + $errMsgHtml = $this->msg( 'permissionserrorstext-withaction', + count( $err ), $action_desc )->parseAsBlock(); + } else { + $errMsgHtml = $this->msg( 'cannotmove', count( $err ) )->parseAsBlock(); + } if ( count( $err ) == 1 ) { $errMsg = $err[0]; @@ -542,7 +547,7 @@ class MovePageForm extends UnlistedSpecialPage { $permErrors = $nt->getUserPermissionsErrors( 'delete', $user ); if ( count( $permErrors ) ) { # Only show the first error - $this->showForm( $permErrors ); + $this->showForm( $permErrors, true ); return; } @@ -596,7 +601,7 @@ class MovePageForm extends UnlistedSpecialPage { $permStatus = $mp->checkPermissions( $user, $this->reason ); if ( !$permStatus->isOK() ) { - $this->showForm( $permStatus->getErrorsArray() ); + $this->showForm( $permStatus->getErrorsArray(), true ); return; }