X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUndelete.php;h=469fe7f7e32b798f251fb2cc64eca71ab8b95915;hb=df622c4195cc5a9f1b9c2d4197e24f8b852c2861;hp=39b63f4f4dac6c0fb72c21590ce7d19edfba7bac;hpb=9b31f5324f6193ac483c7d0a607d62f74f6788ab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 39b63f4f4d..469fe7f7e3 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -30,14 +30,16 @@ class ApiUndelete extends ApiBase { public function execute() { - $params = $this->extractRequestParams(); + $this->useTransactionalTimeLimit(); - if ( !$this->getUser()->isAllowed( 'undelete' ) ) { + $params = $this->extractRequestParams(); + $user = $this->getUser(); + if ( !$user->isAllowed( 'undelete' ) ) { $this->dieUsageMsg( 'permdenied-undelete' ); } - if ( $this->getUser()->isBlocked() ) { - $this->dieUsageMsg( 'blockedtext' ); + if ( $user->isBlocked() ) { + $this->dieBlocked( $user->getBlock() ); } $titleObj = Title::newFromText( $params['title'] ); @@ -69,7 +71,7 @@ class ApiUndelete extends ApiBase { } if ( $retval[1] ) { - wfRunHooks( 'FileUndeleteComplete', + Hooks::run( 'FileUndeleteComplete', array( $titleObj, $params['fileids'], $this->getUser(), $params['reason'] ) ); } @@ -121,7 +123,7 @@ class ApiUndelete extends ApiBase { return 'csrf'; } - public function getExamplesMessages() { + protected function getExamplesMessages() { return array( 'action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page' => 'apihelp-undelete-example-page',