// Set a dummy $wgTitle, because $wgTitle == null breaks various things
// In a perfect world this wouldn't be necessary
-$wgTitle = Title::newFromTitle('API');
+$wgTitle = Title::newFromText('API');
/* Construct an ApiMain with the arguments passed via the URL. What we get back
* is some form of an ApiMain, possibly even one that produces an error message,
$this->dieUsageMsg(array('invalidtitle', $params['title']));
// Some functions depend on $wgTitle == $ep->mTitle
global $wgTitle;
- $titleObj = $wgTitle;
+ $wgTitle = $titleObj;
if($params['createonly'] && $titleObj->exists())
$this->dieUsageMsg(array('createonly-exists'));