Commit graph

3 commits

Author SHA1 Message Date
Dreamy Jazz
33ac22c576 Allow ContributionsSpecialPage to accept usemodwiki IP addresses
Why:
* In 19238b429f, the
  ContributionsSpecialPage class was modified to not perform
  queries if the submitted form data was not determined to
  be valid.
* This was necessary to allow IPContributions in CheckUser to
  not run the query if the form was invalid.
* However, this broke looking up contributions from IPs that have
  the UseMod wiki format (i.e. "xxx" instead of the last octet of
  an IPv4 address) because the HTMLUserTextField class does not
  consider these as valid IP addresses.
* Fixing this is necessary to allow looking up contributions from
  these IPs in the contribution pagers.

What:
* Update HTMLUserTextField to have a 'usemodwiki-ipallowed' option
  that when specified as true will allow IP addresses in with the
  UseMod wiki format.
** This is done via the regex used by UserDef::processUser which
   determines if an IP is a UseMod wiki IP
** This option is only used if the 'ipallowed' option is also set
   to true.
* Update ContributionsSpecialPage::getTargetField to specify that
  the 'target' field should allow UseMod wiki IP addresses.
* Add tests for the changes to HTMLUserTextField and also a
  regression test via SpecialContributionsTest.

Bug: T370413
Change-Id: I2b1d981a21c7b85c22a371708776c7ca127dec4c
2024-08-19 16:31:47 +00:00
Bartosz Dziewoński
3abcd09bb4 Use variable-length argument lists instead of func_get_args()
(plus some other tweaks to code using array unpacking weirdly)

Change-Id: I76a280548952ee5144ca7e75e00d530ad55c22d7
2024-08-16 18:42:01 +00:00
James D. Forrester
ff911bf2ff tests: Namespace and consolidate existing HTMLForm tests
This doesn't alter code coverage, but it puts all the tests in
one place so we can improve them consistently.

Change-Id: I5e2124704aa8dc4b45be17d61fbc2fbd606661b9
2024-03-08 08:11:16 -05:00
Renamed from tests/phpunit/integration/includes/htmlform/HTMLUserTextFieldTest.php (Browse further)