Provide some info on which case value was not handled in ApiLogin
[lhc/web/wiklou.git] / includes / api / ApiUndelete.php
index 58860bd..412e283 100644 (file)
@@ -28,7 +28,7 @@ if (!defined('MEDIAWIKI')) {
 }
 
 /**
- * @addtogroup API
+ * @ingroup API
  */
 class ApiUndelete extends ApiBase {
 
@@ -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,6 +75,10 @@ class ApiUndelete extends ApiBase {
                if(!is_array($retval))
                        $this->dieUsageMsg(array('cannotundelete'));
 
+               if($retval[1])
+                       wfRunHooks( 'FileUndeleteComplete', 
+                               array($titleObj, array(), $wgUser, $params['reason']) );
+
                $info['title'] = $titleObj->getPrefixedText();
                $info['revisions'] = $retval[0];
                $info['fileversions'] = $retval[1];