Last modified: 2013-01-14 19:56:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27174, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25174 - boolean (url) variables are treated differently by the api depending on if POST or GET is used
boolean (url) variables are treated differently by the api depending on if PO...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.16.x
All All
: Normal trivial (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-14 18:42 UTC by Bawolff (Brian Wolff)
Modified: 2013-01-14 19:56 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bawolff (Brian Wolff) 2010-09-14 18:42:07 UTC
I'm not 100% sure if this is even if this is a bug or not (And if it is, it might be a php/apache bug, not a mediawiki bug), but it confused me for a little bit.

Basically, make a GET request like http://example.com/api.php?action=query&prop=revisions&titles=Main%20Page&rvprop=content&rvgeneratexml

It works as expected. Now try POSTing the equivelent (with a content-type of application/x-www-form-urlencoded):  action=query&prop=revisions&titles=Main%20Page&rvprop=content&rvgeneratexml

It doesn't work unless you have an = sign after the rvgeneratexml. This is especially confusing because in the example given for the edit module it gives the example action=edit&title=Test&summary=NOTOC&minor&prependtext=__NOTOC__%0A&basetimestamp=20070824123454&token=%2B\

Which won't be marked as minor if POSTed. 

(I discovered this trying to figure out why my bot's edit wasn't being marked as bot. I was doing my testing using wget if it matters.).
Comment 1 Bryan Tong Minh 2010-11-23 20:40:00 UTC
Let's just add the equal sign to the examples.
Comment 2 Sam Reed (reedy) 2010-11-23 21:32:07 UTC
Are you going to do this Bryan? :P
Comment 3 Bryan Tong Minh 2010-11-23 21:53:40 UTC
uhhh no? :p
Comment 4 Sam Reed (reedy) 2010-11-23 22:32:28 UTC
r77192 (By Bryan)
Comment 5 Yuri Astrakhan 2013-01-13 01:05:10 UTC
Has anyone figured out why this was happening though? Is that a MW feature or PHP? It would be better to make the MW understand both.
Comment 6 Brad Jorsch 2013-01-14 19:56:43 UTC
(In reply to comment #5)
> Has anyone figured out why this was happening though? Is that a MW feature or
> PHP? It would be better to make the MW understand both.

It's PHP. As far as I can tell, way back in 2000 (a6393de6 in PHP's git) they split their code for POST handling from that for GET handling. Then in 2002 (92e542db) they fixed the fact that foo.php?x&y&z wouldn't register x or y or z, but didn't make the analogous change for the POST handling. I didn't see any reference to a bug in their bug tracker.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links