From c4370f6c73a112ea9b900938f0be76fa31b0d7e8 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 24 May 2008 20:48:45 +0000 Subject: [PATCH] On second thought file undeletion is supported; just not undeleting a specific file. Added relevant hook for this. --- includes/api/ApiUndelete.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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]; -- 2.20.1