Pass through request parameters in API action=edit

In addition to constructing a fake request using the data the caller
gave us, also pass through any other request variables that might have
been set. This is a bit of an evil hack, but it's the only thing we can
do to make random things like wpReviewEdit in FlaggedRevs work through
the API.

Change-Id: Idab5b524b0e3daae58ab4f26466c0f6d9d8d3044
This commit is contained in:
Roan Kattouw 2013-07-23 23:26:37 -07:00
parent 17ad68087c
commit e617dc6c8f

View file

@ -293,6 +293,10 @@ class ApiEditPage extends ApiBase {
$requestArray['wpWatchthis'] = '';
}
// Pass through anything else we might have been given, to support extensions
// This is kind of a hack but it's the best we can do to make extensions work
$requestArray += $this->getRequest()->getValues();
global $wgTitle, $wgRequest;
$req = new DerivativeRequest( $this->getRequest(), $requestArray, true );