From: Roan Kattouw Date: Tue, 27 May 2008 16:54:14 +0000 (+0000) Subject: In the spirit of r35407, don't go crazy if Title::moveTo() returns a string (which... X-Git-Tag: 1.31.0-rc.0~47349 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=f43e8e6857a62b10992c12d923ae86d53a6cc549;p=lhc%2Fweb%2Fwiklou.git In the spirit of r35407, don't go crazy if Title::moveTo() returns a string (which it sometimes does) --- diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index 9baf3dd4a7..3d22cfcbdf 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -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'))