On second thought file undeletion is supported; just not undeleting a specific file...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 24 May 2008 20:48:45 +0000 (20:48 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 24 May 2008 20:48:45 +0000 (20:48 +0000)
includes/api/ApiUndelete.php

index b9f01c0..11c5d61 100644 (file)
@@ -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];