From: Bryan Tong Minh Date: Sat, 24 May 2008 20:48:45 +0000 (+0000) Subject: On second thought file undeletion is supported; just not undeleting a specific file... X-Git-Tag: 1.31.0-rc.0~47399 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=c4370f6c73a112ea9b900938f0be76fa31b0d7e8;p=lhc%2Fweb%2Fwiklou.git On second thought file undeletion is supported; just not undeleting a specific file. Added relevant hook for this. --- diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index b9f01c08e4..11c5d61998 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -59,9 +59,6 @@ class ApiUndelete extends ApiBase { $titleObj = Title::newFromText($params['title']); if(!$titleObj) $this->dieUsageMsg(array('invalidtitle', $params['title'])); - - if ($titleObj->getNamespace() == NS_IMAGE) - $this->dieUsage('File undeletion is not supported', 'fileundeletionunsupported'); // Convert timestamps if(!is_array($params['timestamps'])) @@ -76,8 +73,9 @@ class ApiUndelete extends ApiBase { if(!is_array($retval)) $this->dieUsageMsg(array('cannotundelete')); - //wfRunHooks( 'FileUndeleteComplete', array( - // $titleObj, $this->mFileVersions, $wgUser, $params['reason']) ); + if($retval[1]) + wfRunHooks( 'FileUndeleteComplete', + array($titleObj, array(), $wgUser, $params['reason']) ); $info['title'] = $titleObj->getPrefixedText(); $info['revisions'] = $retval[0];