I need an edit token for a faux request (fauxRequest) I am doing. I thought I could get a token like so:
global $wgRequest; $token = $wgRequest->getSessionData( 'wsEditToken' );
But it just reports back "badtoken: Invalid token"
What is the proper way to ger an edit token for a faux request
Thanks, -Adam
On Sat, Jun 18, 2011 at 7:21 AM, Adam Meyer meyer7@mindspring.com wrote:
I need an edit token for a faux request (fauxRequest) I am doing. I thought I could get a token like so:
global $wgRequest; $token = $wgRequest->getSessionData( 'wsEditToken' );
But it just reports back "badtoken: Invalid token"
What is the proper way to ger an edit token for a faux request
Same way as when making a form or URL for a 'real' request: $wgUser->editToken(). If the thing you're getting a token for requires salt parameters, be sure to use the correct ones.
-- brion
Perfect. Thank you! I saw way too many bad examples that lead me astray.
On Jun 18, 2011, at 2:19 PM, Brion Vibber wrote:
On Sat, Jun 18, 2011 at 7:21 AM, Adam Meyer meyer7@mindspring.com wrote:
I need an edit token for a faux request (fauxRequest) I am doing. I thought I could get a token like so:
global $wgRequest; $token = $wgRequest->getSessionData( 'wsEditToken' );
But it just reports back "badtoken: Invalid token"
What is the proper way to ger an edit token for a faux request
Same way as when making a form or URL for a 'real' request: $wgUser->editToken(). If the thing you're getting a token for requires salt parameters, be sure to use the correct ones.
-- brion _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Makes sense.
Just incase it will help anyone, I added it to http://www.mediawiki.org/wiki/API:Calling_internally
On Jun 18, 2011, at 7:10 PM, Platonides wrote:
Adam Meyer wrote:
Perfect. Thank you! I saw way too many bad examples that lead me astray.
I think it may have changed recently.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org