mediawiki-extensions-Gadgets/tests/phpunit
Ammarpad 5d3a547c8b Restrict ?withgadget query parameter to opt-in gadgets.
?withgadget query parameters allows for ad-hoc loading of gadgets
(after passing all other basic checks). This was recently added in
I5b30d4e.

In T29766#7611796 Gergo raised concerns about how this can be
potentially abused.

This patch aims to restrict the feature by giving gadgets latitude
to either use it or not depending on the nature of the gadget.

The patch does so by adding `supportsUrlLoad` option that gadgets
(maybe those deemed safe) can use it to opt-in to the parameter.
By default gadgets don't support it, so it can be enabled for each
on a case-by-case basis.

Bug: T29766
Change-Id: Ie64174085e650579d76cc862774a4fe1b3d08396
2022-01-24 00:31:19 +00:00
..
integration Support JSON files in gadgets 2021-12-27 17:33:21 +00:00
unit Restrict ?withgadget query parameter to opt-in gadgets. 2022-01-24 00:31:19 +00:00
GadgetTestUtils.php Support JSON files in gadgets 2021-12-27 17:33:21 +00:00