Commit graph

11 commits

Author SHA1 Message Date
Thiemo Kreuz
47171f7b94 Don't accept empty option group names for dropdown elements
When this code parses a string that looks like this:

*
** A
** B

It creates an option group with 2 options, but the name
of the group is an empty string. This makes the OOUI
DropdownInputWidget fail later.

Since the empty group name is useless anyway, drop it. This
makes the code behave as if the parsed string looked like
this:

* A
* B

Live example for the issue:
https://el.wikipedia.org/wiki/MediaWiki:Protect-dropdown

Bug: T275125
Change-Id: I780c1be27740b0ed3b35aa569b5a528112d7238f
2021-02-19 17:04:35 +01:00
Umherirrender
e4d1a2c8bd Use __CLASS__/::class to define callback for array_map/_filter/usort
Change-Id: I3519dd5a1ce1ea688de602190cd74755c400c717
2021-01-22 16:39:29 +00:00
Umherirrender
e9e784a09e build: Enable phan-taint-check-plugin and suppress issues
Taint check checks for possible security issues by tracking html
escaping and more by using phan.
This slows done the phan-job a bit and requires more ram

Keep the DoubleEscaped issues out to make reviewer easier

Adds suppression for false positives
Adds taint-annotation to help taint-check
Removes suppression for code phan now understand better by the tracking
of keys in taint-check
Fix some small issues by adding int cast or htmlspecialchars calls

Bug: T216348
Bug: T268920
Change-Id: I849ac4f120fd15b483e8939d4db45c98dc351259
2020-12-30 19:02:22 +01:00
Umherirrender
2579ca623a build: Updating mediawiki/mediawiki-codesniffer to 34.0.0
Change-Id: I2fb18ddd4c144655a665792901e59f88bcd906dc
2020-12-07 14:55:24 +01:00
Umherirrender
a71552ad28 Improve docs for Xml class
Change-Id: I856b9bc4b62ddb8f03ed8f9111fc0dc037ff1046
2020-11-28 23:48:36 +01:00
Thiemo Kreuz
b0130ca649 Update a lot of unspecific "array" types in PHPDocs
This includes fixing some mistakes, as well as removing
redundant text that doesn't add new information, either because
it literally repeats what the code already says, or is actually
duplicated.

Change-Id: I3a8dd8ce57192deda8916cc444c87d7ab1a36515
2020-10-28 11:01:33 +01:00
Umherirrender
e878341bfc Drop down lists: Do not use the value for 'other' as option group
Instead use them as groupless reason list

Bug: T251351
Change-Id: Id691d97e3e6f205615f639e051619f3d0f67c7ba
2020-09-16 19:30:43 +00:00
Umherirrender
ba216e52e7 includes: Use expression assignment operator += or |= where possible
It is easier to read.

Change-Id: Ia3965b80153d64f95b415c6c30f526efa252f554
2020-07-31 22:26:42 +00:00
Derick A
02b5d008c5 xml: Move condition check of var before creating XmlSelect object
The `$selected` var could be null and in this case, return the default,
an empty string. The null check was after creating the XmlSelect
object which seemed out of place as after setting the variable to
the default, it's not used anywhere below.

Actually, the check should happen above and set it to it's default if
need be before creating the object below.

Change-Id: I6b69a7780c9f4a9ae283db8fa90b9cee76954d00
2020-04-27 00:37:31 +01:00
Sam Wilson
02db290c64 Unify handling of options messages
There are a few messages that use a custom format for select
lists. This moves the parsing of these messages into a single
method.

Bug: T245565
Change-Id: I0a24d3458979d7cca2dc3cb38c1b0f700a88490a
2020-03-27 11:19:43 +08:00
Aaron Schulz
97fa6ff265 Move Xml* classes under /xml
Change-Id: I012648c9a860611a7cd809119073803e82429fc3
2020-03-19 19:23:47 -07:00