Same idea as in T274329
- Introduce AbstractBlock::getTargetIdentity
- Find all usages of AbstractBlock::getTarget, replace
- Hard-deprecate AbstractBlock::getTarget
Same idea as in T274329
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| WIP: Introduce Blocked interface to represent block target | mediawiki/core | master | +455 -226 | |
| Hard-deprecate AbstractBlock::parseTarget | mediawiki/core | master | +76 -22 |
Change 671603 had a related patch set uploaded (by Peter.ovchyn; owner: Peter.ovchyn):
[mediawiki/core@master] Introduce getTargetIdentity for AbstractBlock
I have a concern about this: blocks can target IP ranges. This is also the reason why AbstractBlock::$target can be a string. I see that the patch above will create a UserIdentityValue by supplying the range as username. Unless I'm missing something (in which case I apologize), this is wrong because it violates the requirements of the UserIdentity interface.
Yup, the patch is incorrect. We only need to return UserOdentity when previously User was returned. String for the ip range should still be returned
Oh right, this makes sense. I thought we wanted to always return a UserIdentity, which would be impossible right now, and I somehow didn't consider that we can just keep returning a string in the range case.
Change 673068 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Hard-deprecate AbstractBlock::parseTarget
Change 673068 merged by jenkins-bot:
[mediawiki/core@master] Hard-deprecate AbstractBlock::parseTarget
Change 671603 abandoned by Ppchelko:
[mediawiki/core@master] WIP: Introduce Blocked interface to represent block target
Reason:
superseded