Followup to r50132: I guess I was smoking some pretty good stuff there
authorRoan Kattouw <catrope@users.mediawiki.org>
Sat, 2 May 2009 15:03:02 +0000 (15:03 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sat, 2 May 2009 15:03:02 +0000 (15:03 +0000)
api.php
includes/api/ApiEditPage.php

diff --git a/api.php b/api.php
index 8702ce1..2f1d1a3 100644 (file)
--- a/api.php
+++ b/api.php
@@ -74,7 +74,7 @@ define('API', true);
 
 // 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,
index 4fb21fb..09731e7 100644 (file)
@@ -60,7 +60,7 @@ class ApiEditPage extends ApiBase {
                        $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'));