Well I saved/restored $wgOut, $wgRequest and $wgTitle
but it had no effect.
Looking through the API, it looks like it already does this to some extent:
# Fake $wgRequest for some hooks inside EditPage
# FIXME: This interface SUCKS
$oldRequest = $wgRequest;
$wgRequest = $req;
So it looks like more hunting will be required to find out exactly what needs
to be saved.
Yeah, I noticed the API already saves $wgRequest. Could you try doing
$wgOut->disable(); after saving $wgOut?
Hmm, well that stops the output and leaves me with a blank page (no HTML or
anything.) The URL contains the correct address though (of my Special page,
it hasn't changed to the URL of the last page edited.)
I wonder why the output doesn't seem to get enabled again after restoring
$wgOut? No errors about headers or anything being set already...
You're probably doing something like
global $wgOut;
$oldOut = $wgOut;
$wgOut->disable();
// do API call
$wgOut = $oldOut;
If that doesn't work, try to replace the second line with $oldOut =
clone $wgOut;
Roan Kattouw (Catrope)