// 'badtitletext' => shouldn't happen
// API-specific messages
- 'notitle' => array('code' => 'notitle', 'info' => "The title parameter must be set"),
- 'notoken' => array('code' => 'notoken', 'info' => "The token parameter must be set"),
- 'nouser' => array('code' => 'nouser', 'info' => "The user parameter must be set"),
- 'nofrom' => array('code' => 'nofrom', 'info' => "The from parameter must be set"),
- 'noto' => array('code' => 'noto', 'info' => "The to parameter must be set"),
+ 'missingparam' => array('code' => 'no$1', 'info' => "The \$1 parameter must be set"),
'invalidtitle' => array('code' => 'invalidtitle', 'info' => "Bad title ``\$1''"),
'invaliduser' => array('code' => 'invaliduser', 'info' => "Invalid username ``\$1''")
);
public function dieUsageMsg($error) {
$key = array_shift($error);
if(isset(self::$messageMap[$key]))
- $this->dieUsage(wfMsgReplaceArgs(self::$messageMap[$key]['info'], $error), self::$messageMap[$key]['code']);
+ $this->dieUsage(wfMsgReplaceArgs(self::$messageMap[$key]['info'], $error), wfMsgReplaceArgs(self::$messageMap[$key]['code'], $error));
// If the key isn't present, throw an "unknown error"
$this->dieUsageMsg(array('unknownerror', $key));
}
$titleObj = NULL;
if(!isset($params['title']))
- $this->dieUsageMsg(array('notitle'));
+ $this->dieUsageMsg(array('missingparam', 'title'));
if(!isset($params['token']))
- $this->dieUsageMsg(array('notoken'));
+ $this->dieUsageMsg(array('missingparam', 'token'));
$titleObj = Title::newFromText($params['title']);
if(!$titleObj)
$titleObj = NULL;
if(!isset($params['from']))
- $this->dieUsageMsg(array('nofrom'));
+ $this->dieUsageMsg(array('missingparam', 'from'));
if(!isset($params['to']))
- $this->dieUsageMsg(array('noto'));
+ $this->dieUsageMsg(array('missingparam', 'to'));
if(!isset($params['token']))
- $this->dieUsageMsg(array('notoken'));
+ $this->dieUsageMsg(array('missingparam', 'token'));
if(!$wgUser->matchEditToken($params['token']))
$this->dieUsageMsg(array('sessionfailure'));
$titleObj = NULL;
if(!isset($params['title']))
- $this->dieUsageMsg(array('notitle'));
+ $this->dieUsageMsg(array('missingparam', 'title'));
if(!isset($params['user']))
- $this->dieUsageMsg(array('nouser'));
+ $this->dieUsageMsg(array('missingparam', 'user'));
if(!isset($params['token']))
- $this->dieUsageMsg(array('notoken'));
+ $this->dieUsageMsg(array('missingparam', 'token'));
$titleObj = Title::newFromText($params['title']);
if(!$titleObj)