HomePhabricator

mediawiki.api: Correctly handle boolean parameters

Authored by matmarex.

Description

mediawiki.api: Correctly handle boolean parameters

Quoting https://www.mediawiki.org/w/api.php#main.2Fdatatypes:

Boolean parameters work like HTML checkboxes: if the parameter is
specified, regardless of value, it is considered true. For a false
value, omit the parameter entirely.

Therefore, omit the parameters if the value is false.

The idea is adapted from MobileFrontend's api.js.

Change-Id: I596e14304951f49acc36159cb806b266117fb550

Details

Committed
matmarexAug 20 2015, 3:46 PM
Parents
rMWedda7119a8a3: Merge "Add public keywords to QueryPage subclasses"
Branches
Unknown
Tags
Unknown
ChangeId
I596e14304951f49acc36159cb806b266117fb550