In the spirit of r35407, don't go crazy if Title::moveTo() returns a string (which...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 27 May 2008 16:54:14 +0000 (16:54 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 27 May 2008 16:54:14 +0000 (16:54 +0000)
includes/api/ApiMove.php

index 9baf3dd..3d22cfc 100644 (file)
@@ -83,7 +83,13 @@ class ApiMove extends ApiBase {
 
                $retval = $fromTitle->moveTo($toTitle, true, $params['reason'], !$params['noredirect']);
                if($retval !== true)
-                       $this->dieUsageMsg(reset($retval));
+               {
+                       # FIXME: Title::moveTo() sometimes returns a string
+                       if(is_array($retval))
+                               $this->dieUsageMsg(reset($retval));
+                       else
+                               $this->dieUsageMsg(array('unknownerror', $error));
+               }
 
                $r = array('from' => $fromTitle->getPrefixedText(), 'to' => $toTitle->getPrefixedText(), 'reason' => $params['reason']);
                if(!$params['noredirect'] || !$wgUser->isAllowed('suppressredirect'))