API: Fixing exception in ApiEditPage
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 30 Mar 2008 19:20:42 +0000 (19:20 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 30 Mar 2008 19:20:42 +0000 (19:20 +0000)
includes/api/ApiEditPage.php

index e4a64fd..1f96122 100644 (file)
@@ -123,6 +123,7 @@ class ApiEditPage extends ApiBase {
                # Run hooks
                # We need to fake $wgRequest for some of them
                global $wgRequest;
+               $oldRequest = $wgRequest;
                $wgRequest = $req;
                $r = array();
                if(!wfRunHooks('APIEditBeforeSave', array(&$ep, $ep->textbox1, &$r)))
@@ -136,6 +137,7 @@ class ApiEditPage extends ApiBase {
                        else
                                $this->dieUsageMsg(array('hookaborted'));
                }
+               $wgRequest = $oldRequest;
                
                # Do the actual save
                $oldRevId = $articleObj->getRevIdFetched();