diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
commit | 370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch) | |
tree | 491674f4c242e4d6ba0d04eafa305174c35a3391 /includes/api/ApiUndelete.php | |
parent | f4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff) |
Update auf 1.13.0
Diffstat (limited to 'includes/api/ApiUndelete.php')
-rw-r--r-- | includes/api/ApiUndelete.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index b27841a8..e054a70e 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -28,7 +28,7 @@ if (!defined('MEDIAWIKI')) { } /** - * @addtogroup API + * @ingroup API */ class ApiUndelete extends ApiBase { @@ -40,7 +40,7 @@ class ApiUndelete extends ApiBase { global $wgUser; $this->getMain()->requestWriteMode(); $params = $this->extractRequestParams(); - + $titleObj = NULL; if(!isset($params['title'])) $this->dieUsageMsg(array('missingparam', 'title')); @@ -61,6 +61,8 @@ class ApiUndelete extends ApiBase { $this->dieUsageMsg(array('invalidtitle', $params['title'])); // Convert timestamps + if(!isset($params['timestamps'])) + $params['timestamps'] = array(); if(!is_array($params['timestamps'])) $params['timestamps'] = array($params['timestamps']); foreach($params['timestamps'] as $i => $ts) @@ -73,16 +75,19 @@ class ApiUndelete extends ApiBase { if(!is_array($retval)) $this->dieUsageMsg(array('cannotundelete')); - $dbw->commit(); + if($retval[1]) + wfRunHooks( 'FileUndeleteComplete', + array($titleObj, array(), $wgUser, $params['reason']) ); + $info['title'] = $titleObj->getPrefixedText(); $info['revisions'] = $retval[0]; $info['fileversions'] = $retval[1]; $info['reason'] = $retval[2]; $this->getResult()->addValue(null, $this->getModuleName(), $info); } - + public function mustBePosted() { return true; } - + public function getAllowedParams() { return array ( 'title' => null, @@ -118,6 +123,6 @@ class ApiUndelete extends ApiBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiUndelete.php 30222 2008-01-28 19:05:26Z catrope $'; + return __CLASS__ . ': $Id: ApiUndelete.php 35348 2008-05-26 10:51:31Z catrope $'; } } |