See https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/97309/console
Affected patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/638528
Seems to be consistent with N=2.
See https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/97309/console
Affected patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/638528
Seems to be consistent with N=2.
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| (MW) Add partial support for HookHandlers | Daimona Eaytoy | mediawiki/tools/phan/SecurityCheckPlugin | master | +82 -20 |
It looks like Phan is incorrectly assuming that the key in HookHandlers is a class name:
"HookHandlers": {
"message-bundle": {
"factory": "MediaWiki\\Extensions\\Translate\\MessageBundleTranslation\\Hooks::getInstance"
}
},The dash in the key makes it invalid class names and exposes this bug.
Related to T250499, taint-check doesn't have support for HookHandlers. It should copy what ExtensionProcessor does: extract a list out of HookHandlers, and give it preference over literals when analyzing Hooks. This part should be trivial. The less trivial part is interpreting the structure of a single HookHandlers entry, i.e. the syntax used by ObjectFactory. I think special-casing the "basic" keys ("class", maybe "args") would be the best option for now, and it would also be trivial to implement.
Proper solution would be to have generic code for handling ObjectFactory, which should be used here as well, but that should be added to a generic phan plugin for MediaWiki (and not taint-check), which is something I've been thinking about for a long time, but never really implemented.
Oh, also, a temporary workaround would be to avoid using the dash in the handler name. Taint-check will still try and get a class from that, but the failure would be silent.
Change 666949 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/tools/phan/SecurityCheckPlugin@master] (MW) Add partial support for HookHandlers
Change 666949 merged by jenkins-bot:
[mediawiki/tools/phan/SecurityCheckPlugin@master] (MW) Add partial support for HookHandlers