API: Go back to using the good old str_replace() hacks rather than Title methods...
[lhc/web/wiklou.git] / includes / api / ApiMove.php
index 60873a8..a3801bf 100644 (file)
@@ -29,7 +29,7 @@ if (!defined('MEDIAWIKI')) {
 
 
 /**
- * @addtogroup API
+ * @ingroup API
  */
 class ApiMove extends ApiBase {
 
@@ -79,9 +79,14 @@ class ApiMove extends ApiBase {
                        // We don't care about multiple errors, just report one of them
                        $this->dieUsageMsg(current($errors));
 
+               $hookErr = null;
+
                $retval = $fromTitle->moveTo($toTitle, true, $params['reason'], !$params['noredirect']);
                if($retval !== true)
-                       $this->dieUsageMsg(array($retval));
+               {
+                       # FIXME: Title::moveTo() sometimes returns a string
+                       $this->dieUsageMsg(reset($retval));
+               }
 
                $r = array('from' => $fromTitle->getPrefixedText(), 'to' => $toTitle->getPrefixedText(), 'reason' => $params['reason']);
                if(!$params['noredirect'] || !$wgUser->isAllowed('suppressredirect'))