A bogus return value in line https://phabricator.wikimedia.org/diffusion/ECIT/browse/master/includes/Cite.php$422 which is already marked with a FIXME makes it so that the extension ignores all parameters in a <ref …> the moment there are more than 2 parameters. This makes the extension behave utterly inconcistent:
- <ref a="…" b="…"> is invalid and results in an error, but <ref a="…" b="…" c="…"> appears as if it is fine.
- <ref name="…" follow="…"> is blocked with an error message (because the two parameters are in conflict) but <ref name="…" follow="…" dummy="…"> is accepted.
- <ref name="…" group="…"> works as it should, but in <ref name="…" group="…" dummy="…"> the name and group are silently ignored.
- <ref name="…" dummy="…"> is blocked because of the unknown parameter, but <ref name="…" dummy="…" foo="…"> is not.
Since we are planning to possibly add more parameters as part of a German-Community-Wishlist project (see T100645 and it's sub-tasks), the best solution is to remove the > 2 check entirely and rely on the later check for unknown parameters. Tests should be in place to make sure the (intended) behavior does not change.
TODOs:
- There are currently zero tests for any of these edge cases!
Since when does this issue exists?The bogus return false exists basically "forever", at least since 2008. It always had the effect that all parameters are ignored.- Can we estimate how many pages are affected?
- Should we revisit the decision to fail hard with an error message the moment an unknown parameter is detected?